From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: use btrfs_dev_name() helper to handle missing devices better
Date: Mon, 14 Nov 2022 20:30:53 +0100 [thread overview]
Message-ID: <20221114193053.GX5824@twin.jikos.cz> (raw)
In-Reply-To: <071d7f1c5f10d185146b83dd665a68ae5a4c9303.1668303064.git.wqu@suse.com>
On Sun, Nov 13, 2022 at 09:32:07AM +0800, Qu Wenruo wrote:
> [BUG]
> If dev-replace failed to re-construct its data/metadata, the kernel
> message would be incorrect for the missing device:
>
> BTRFS info (device dm-1): dev_replace from <missing disk> (devid 2) to /dev/mapper/test-scratch2 started
> BTRFS error (device dm-1): failed to rebuild valid logical 38862848 for dev (efault)
>
> Note the above "dev (efault)" of the second line.
> While the first line is properly reporting "<missing disk>".
>
> [CAUSE]
> Although dev-replace is using btrfs_dev_name(), the heavy lifting work
> is still done by scrub (scrub is reused by both dev-replace and regular
> scrub).
>
> Unfortunately scrub code never uses btrfs_dev_name() helper, as it's
> only declared locally inside dev-replace.c.
>
> [FIX]
> Fix the output by:
>
> - Move the btrfs_dev_name() helper to volumes.h
>
> - Use btrfs_dev_name() to replace open-coded rcu_str_defref() calls
> Only zoned code is not touched, as I'm not familiar with degraded
> zoned code.
>
> Now the output looks pretty sane:
>
> BTRFS info (device dm-1): dev_replace from <missing disk> (devid 2) to /dev/mapper/test-scratch2 started
> BTRFS error (device dm-1): failed to rebuild valid logical 38862848 for dev <missing disk>
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Added to misc-next, thanks.
prev parent reply other threads:[~2022-11-14 19:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 1:32 [PATCH] btrfs: use btrfs_dev_name() helper to handle missing devices better Qu Wenruo
2022-11-13 3:05 ` Anand Jain
2022-11-14 19:30 ` David Sterba [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=20221114193053.GX5824@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--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