summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2024-04-16 10:06:58 +0800
committerDavid Sterba <dsterba@suse.com>2024-05-07 21:31:07 +0200
commit9a7b68d32afc4e92909c21e166ad993801236be3 (patch)
treee0c4e71c71422772160cbbffb6a72f0fd20bd3cc /fs/btrfs
parentfef998d1a0b00ab35658484060354213a2c06c81 (diff)
btrfs: report filemap_fdata<write|wait>_range() error
In the function btrfs_write_marked_extents() and in __btrfs_wait_marked_extents() return the actual error if when filemap_fdata<write|wait>_range() fails. Suggested-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/transaction.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 3e3bcc5f64c6..8c3b3cda1390 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1156,6 +1156,8 @@ int btrfs_write_marked_extents(struct btrfs_fs_info *fs_info,
else if (wait_writeback)
werr = filemap_fdatawait_range(mapping, start, end);
free_extent_state(cached_state);
+ if (werr)
+ break;
cached_state = NULL;
cond_resched();
start = end + 1;
@@ -1198,6 +1200,8 @@ static int __btrfs_wait_marked_extents(struct btrfs_fs_info *fs_info,
if (err)
werr = err;
free_extent_state(cached_state);
+ if (werr)
+ break;
cached_state = NULL;
cond_resched();
start = end + 1;