public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: warn about dev extents that are inside the reserved range
Date: Mon, 13 Jun 2022 12:05:10 -0700	[thread overview]
Message-ID: <YqeKZuET4MDe0D5w@zen> (raw)
In-Reply-To: <c4b02ac7bf6e4171d8cfb13dcd11b3bad8d2e4df.1655103954.git.wqu@suse.com>

On Mon, Jun 13, 2022 at 03:06:35PM +0800, Qu Wenruo wrote:
> Btrfs has reserved the first 1MiB for the primary super block (at 64KiB
> offset) and legacy programs like older bootloaders.
> 
> This behavior is only introduced since v4.1 btrfs-progs release,
> although kernel can ensure we never touch the reserved range of super
> blocks, it's better to inform the end users, and a balance will resolve
> the problem.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  fs/btrfs/volumes.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 051d124679d1..b39f4030d2ba 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -7989,6 +7989,16 @@ static int verify_one_dev_extent(struct btrfs_fs_info *fs_info,
>  		goto out;
>  	}
>  
> +	/*
> +	 * Very old mkfs.btrfs (before v4.1) will not respect the reserved
> +	 * space. Although kernel can handle it without problem, better to
> +	 * warn the users.
> +	 */
> +	if (physical_offset < BTRFS_DEFAULT_RESERVED)
> +		btrfs_warn(fs_info,
> +"devid %llu physical %llu len %llu is inside the reserved space, balance is needed to solve this problem.",

If I saw this warning, I wouldn't know what balance to run, and it's
not obvious what to search for online either (if it's even documented).
I think a more explicit instruction like "btrfs balance start XXXX"
would be helpful.

If it's something we're ok with in general, then maybe a URL for a wiki
page that explains the issue and the workaround would be the most
useful.

> +			   devid, physical_offset, physical_len);
> +
>  	for (i = 0; i < map->num_stripes; i++) {
>  		if (map->stripes[i].dev->devid == devid &&
>  		    map->stripes[i].physical == physical_offset) {
> -- 
> 2.36.1
> 

  reply	other threads:[~2022-06-13 20:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13  7:06 [PATCH 0/2] btrfs: cleanup related to the 1MiB reserved space Qu Wenruo
2022-06-13  7:06 ` [PATCH 1/2] btrfs: introduce BTRFS_DEFAULT_RESERVED macro Qu Wenruo
2022-06-13  9:13   ` Nikolay Borisov
2022-06-13  9:36     ` Qu Wenruo
2022-06-16 15:20       ` David Sterba
2022-06-17  1:47         ` Qu Wenruo
2022-06-17 14:04           ` David Sterba
2022-06-13  7:06 ` [PATCH 2/2] btrfs: warn about dev extents that are inside the reserved range Qu Wenruo
2022-06-13 19:05   ` Boris Burkov [this message]
2022-06-14  7:48     ` Qu Wenruo
2022-06-14 15:30       ` Boris Burkov
2022-06-14 22:12         ` Qu Wenruo
2022-06-16 15:03           ` David Sterba
2022-06-13 18:20 ` [PATCH 0/2] btrfs: cleanup related to the 1MiB reserved space David Sterba
2022-06-13 23:50   ` Qu Wenruo
2022-06-14 13:56     ` David Sterba

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=YqeKZuET4MDe0D5w@zen \
    --to=boris@bur.io \
    --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