Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "Marek Behún" <marek.behun@nic.cz>
Cc: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org,
	David Sterba <dsterba@suse.com>, Qu Wenruo <wqu@suse.com>
Subject: Re: [PATCH u-boot] fs: btrfs: do not fail when offset of a ROOT_ITEM is not -1
Date: Mon, 1 Mar 2021 22:47:33 -0500	[thread overview]
Message-ID: <20210302034733.GO10169@bill-the-cat> (raw)
In-Reply-To: <20210209173337.16621-1-marek.behun@nic.cz>

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

On Tue, Feb 09, 2021 at 06:33:37PM +0100, Marek Behún wrote:

> When the btrfs_read_fs_root() function is searching a ROOT_ITEM with
> location key offset other than -1, it currently fails via BUG_ON.
> 
> The offset can have other value than -1, though. This can happen for
> example if a subvolume is renamed:
> 
>   $ btrfs subvolume create X && sync
>   Create subvolume './X'
>   $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: X$
>         location key (270 ROOT_ITEM 18446744073709551615) type DIR
>         transid 283 data_len 0 name_len 1
>         name: X
>   $ mv X Y && sync
>   $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: Y$
>         location key (270 ROOT_ITEM 0) type DIR
>         transid 285 data_len 0 name_len 1
>         name: Y
> 
> As can be seen the offset changed from -1ULL to 0.
> 
> Do not fail in this case.
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Cc: David Sterba <dsterba@suse.com>
> Cc: Qu Wenruo <wqu@suse.com>
> Cc: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

      parent reply	other threads:[~2021-03-02  8:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 17:33 [PATCH u-boot] fs: btrfs: do not fail when offset of a ROOT_ITEM is not -1 Marek Behún
2021-02-10  0:09 ` Qu Wenruo
2021-02-10  1:05   ` Marek Behun
2021-02-10  1:20     ` Qu Wenruo
2021-02-10 16:21       ` Marek Behun
2021-02-10 23:24         ` Qu Wenruo
2021-03-02  3:47 ` Tom Rini [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=20210302034733.GO10169@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=u-boot@lists.denx.de \
    --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