Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Miroslav Cimerman <mc@raidlab.org>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>, Chris Mason <mason@kernel.org>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>, Damien Le Moal <dlemoal@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] btrfs: zoned: do not WARN when zones fail to finish before relocation
Date: Sun, 22 Nov 2026 23:23:10 +0000	[thread overview]
Message-ID: <20261122232310.4099580-4-mc@raidlab.org> (raw)
In-Reply-To: <20261122232310.4099580-1-mc@raidlab.org>

btrfs_relocate_block_group() finishes the zones of the block group
before it relocates it. Any error other than -EAGAIN hits a WARN_ON().
However, btrfs_zone_finish() also fails when a device fails ZONE_FINISH.
A device error is not a kernel bug, and relocation continues either way.

Print a warning instead.

Fixes: 7ae9bd18032e ("btrfs: zoned: finish relocating block group")
Signed-off-by: Miroslav Cimerman <mc@raidlab.org>
---
 fs/btrfs/relocation.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index c7b5a655e89f..b60d9a0c5c1d 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -5538,7 +5538,10 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start,
 	btrfs_wait_ordered_roots(fs_info, U64_MAX, rc->block_group);
 
 	ret = btrfs_zone_finish(rc->block_group);
-	WARN_ON(ret && ret != -EAGAIN);
+	if (ret && ret != -EAGAIN)
+		btrfs_warn(fs_info,
+			   "zoned: failed to finish zones of block group %llu before relocation: %d",
+			   rc->block_group->start, ret);
 
 	if (should_relocate_using_remap_tree(bg)) {
 		if (bg->remap_bytes != 0) {
-- 
2.53.0


      parent reply	other threads:[~2026-11-22 23:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 23:23 [PATCH 0/3] btrfs: zoned: handle a failed zone finish on one device Miroslav Cimerman
2026-11-22 23:23 ` [PATCH 1/3] btrfs: zoned: do not fail an ordered extent on a zone finish error Miroslav Cimerman
2026-11-22 23:23 ` [PATCH 2/3] btrfs: zoned: tolerate a failed zone finish on a full block group Miroslav Cimerman
2026-11-22 23:23 ` Miroslav Cimerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122232310.4099580-4-mc@raidlab.org \
    --to=mc@raidlab.org \
    --cc=dlemoal@kernel.org \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox