diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-02-09 18:33:37 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-01 09:53:46 -0500 |
commit | 1afb9f22220d11ebe13cd07431f8e649a65ead6d (patch) | |
tree | a592b52852c1f94470205d13b4881aef84520482 /board/synopsys/iot_devkit/iot_devkit.c | |
parent | 85ae52b9593894fa31d80d83d76bdb3b6432c4be (diff) |
fs: btrfs: do not fail when offset of a ROOT_ITEM is not -1
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>
Diffstat (limited to 'board/synopsys/iot_devkit/iot_devkit.c')
0 files changed, 0 insertions, 0 deletions