Skip to content

Commit f95ebdb

Browse files
josefbacikkdave
authored andcommitted
btrfs: don't WARN if we abort a transaction with EROFS
If we got some sort of corruption via a read and call btrfs_handle_fs_error() we'll set BTRFS_FS_STATE_ERROR on the fs and complain. If a subsequent trans handle trips over this it'll get EROFS and then abort. However at that point we're not aborting for the original reason, we're aborting because we've been flipped read only. We do not need to WARN_ON() here. CC: [email protected] # 5.4+ Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3ebac17 commit f95ebdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/ctree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3279,7 +3279,7 @@ do { \
32793279
/* Report first abort since mount */ \
32803280
if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
32813281
&((trans)->fs_info->fs_state))) { \
3282-
if ((errno) != -EIO) { \
3282+
if ((errno) != -EIO && (errno) != -EROFS) { \
32833283
WARN(1, KERN_DEBUG \
32843284
"BTRFS: Transaction aborted (error %d)\n", \
32853285
(errno)); \

0 commit comments

Comments
 (0)