All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Naohiro Aota <naohiro.aota@wdc.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.com>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH] btrfs-progs: properly format btrfs_header in btrfs_create_root()
Date: Thu, 23 Sep 2021 21:22:45 +0200	[thread overview]
Message-ID: <20210923192245.GY9286@twin.jikos.cz> (raw)
In-Reply-To: <20210923152911.359451-1-naohiro.aota@wdc.com>

On Fri, Sep 24, 2021 at 12:29:11AM +0900, Naohiro Aota wrote:
> Enabling quota on zoned btrfs hits the following ASSERT().
> 
>     $ mkfs.btrfs -f -d single -m single -R quota /dev/nullb0
>     btrfs-progs v5.11
>     See http://btrfs.wiki.kernel.org for more information.
> 
>     Zoned: /dev/nullb0: host-managed device detected, setting zoned feature
>     Resetting device zones /dev/nullb0 (1600 zones) ...
>     bad tree block 25395200, bytenr mismatch, want=25395200, have=0
>     kernel-shared/disk-io.c:549: write_tree_block: BUG_ON `1` triggered, value 1
>     ./mkfs.btrfs(+0x26aaa)[0x564d1a7ccaaa]
>     ./mkfs.btrfs(write_tree_block+0xb8)[0x564d1a7cee29]
>     ./mkfs.btrfs(__commit_transaction+0x91)[0x564d1a7e3740]
>     ./mkfs.btrfs(btrfs_commit_transaction+0x135)[0x564d1a7e39aa]
>     ./mkfs.btrfs(main+0x1fe9)[0x564d1a7b442a]
>     /lib64/libc.so.6(__libc_start_main+0xcd)[0x7f36377d37fd]
>     ./mkfs.btrfs(_start+0x2a)[0x564d1a7b1fda]
>     zsh: IOT instruction  sudo ./mkfs.btrfs -f -d single -m single -R quota /dev/nullb0
> 
> The issue occur because btrfs_create_root() is not formatting the root node
> properly. This is fine on regular btrfs, because it's fortunately reusing
> an once freed buffer. As the previous tree node allocation kindly formatted
> the header, it will see the proper bytenr and pass the checks.
> 
> However, we never reuse an once freed buffer on zoned btrfs. As a result,
> we have zero-filled bytenr, FSID, and chunk-tree UUID, hitting the ASSERTs
> in check_tree_block().
> 
> Reported-by: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Added to devel, thanks.

      reply	other threads:[~2021-09-23 19:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 15:29 [PATCH] btrfs-progs: properly format btrfs_header in btrfs_create_root() Naohiro Aota
2021-09-23 19:22 ` 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=20210923192245.GY9286@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.