Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: zoned: propagate do_zone_finish() error in btrfs_zone_finish_endio()
@ 2026-08-18 10:00 Johannes Thumshirn
  2026-08-18 22:41 ` Qu Wenruo
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2026-08-18 10:00 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba, Naohiro Aota, Johannes Thumshirn

btrfs_zone_finish_endio() ignored the return value of do_zone_finish()
and always returned 0, silently dropping a failed zone finish.

Instead propagate any error from do_zone_finish() as the caller
btrfs_finish_ordered_io() already handles it.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/zoned.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index a016cb471beb..82c2394dd43c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2713,6 +2713,7 @@ int btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 leng
 {
 	struct btrfs_block_group *block_group;
 	u64 min_alloc_bytes;
+	int ret = 0;
 
 	if (!btrfs_is_zoned(fs_info))
 		return 0;
@@ -2732,11 +2733,11 @@ int btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 leng
 	    block_group->start + block_group->zone_capacity)
 		goto out;
 
-	do_zone_finish(block_group, true);
+	ret = do_zone_finish(block_group, true);
 
 out:
 	btrfs_put_block_group(block_group);
-	return 0;
+	return ret;
 }
 
 static void btrfs_zone_finish_endio_workfn(struct work_struct *work)
-- 
2.55.0


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

end of thread, other threads:[~2026-08-19  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 10:00 [PATCH] btrfs: zoned: propagate do_zone_finish() error in btrfs_zone_finish_endio() Johannes Thumshirn
2026-08-18 22:41 ` Qu Wenruo
2026-08-18 22:44   ` Qu Wenruo
2026-08-19  8:34     ` Johannes Thumshirn

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