Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 1/1] btrfs: report filemap_fdata<write|wait>_range error
@ 2024-04-16  2:36 Anand Jain
  2024-04-18  6:14 ` [PATCH v2] " Anand Jain
  0 siblings, 1 reply; 6+ messages in thread
From: Anand Jain @ 2024-04-16  2:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Anand Jain, Josef Bacik

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 --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;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-18  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16  2:36 [PATCH 1/1] btrfs: report filemap_fdata<write|wait>_range error Anand Jain
2024-04-18  6:14 ` [PATCH v2] " Anand Jain
2024-04-18  6:30   ` Qu Wenruo
2024-04-18  7:18     ` Anand Jain
2024-04-18  7:22       ` Qu Wenruo
2024-04-18  8:23         ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox