diff mbox series

[1/1] btrfs: report filemap_fdata<write|wait>_range error

Message ID 80c3c9ccb6e7ea366d88f0e5b2798f5bbd3b381c.1713234880.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series [1/1] btrfs: report filemap_fdata<write|wait>_range error | expand

Commit Message

Anand Jain April 16, 2024, 2:36 a.m. UTC
In the function btrfs_write_marked_extents() in the while loop check and break if
filemap_fdata<write|wait>_range() has any error.

Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/transaction.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index df2e58aa824a..a1c43fa6fd3d 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;