Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID is empty in subvolume list #562

Closed
ccat3z opened this issue Dec 27, 2022 · 5 comments
Closed

UUID is empty in subvolume list #562

ccat3z opened this issue Dec 27, 2022 · 5 comments
Labels
Milestone

Comments

@ccat3z
Copy link

ccat3z commented Dec 27, 2022

UUID is empty in subvolume list after d729048. Test on linux 6.0.12 (ArchLinux).

$ sudo ./btrfs subvolume list -a -u '/mnt/volume'
ID 333 gen 1434028 top level 5 uuid -                                    path a
ID 335 gen 1434109 top level 5 uuid -                                    path b
ID 337 gen 1433478 top level 5 uuid -                                    path c
ID 338 gen 1434124 top level 5 uuid -                                    path d
ID 339 gen 1432646 top level 5 uuid -                                    path e
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Dec 27, 2022
[BUG]
Since commit d729048 ("btrfs-progs: stop using
btrfs_root_item_v0"), "btrfs subvolume list" not longer correctly report
UUID nor timestamp, while older (btrfs-progs v6.0.2) still works
correct:

 v6.0.2:
 # btrfs subv list -u  /mnt/btrfs/
 ID 256 gen 12 top level 5 uuid ed4af580-d512-2644-b392-2a71aaeeb99e path subv1
 ID 257 gen 13 top level 5 uuid a22ccba7-0a0a-a94f-af4b-5116ab58bb61 path subv2

 v6.1:
 # ./btrfs subv list -u /mnt/btrfs/
 ID 256 gen 12 top level 5 uuid -                                    path subv1
 ID 257 gen 13 top level 5 uuid -                                    path subv2

[CAUSE]
Commit d729048 ("btrfs-progs: stop using btrfs_root_item_v0")
removed old btrfs_root_item_v0, but incorrectly changed the check for
v0 root item.

Now we will treat v0 root items as latest root items, causing possible
out-of-bound access. while treat current root items as older v0 root
items, ignoring the UUID nor timestamp.

[FIX]
Fix the bug by using correct checks, and add extra comments on the
branches.

Issue: kdave#562
Fixes: d729048 ("btrfs-progs: stop using btrfs_root_item_v0")
Signed-off-by: Qu Wenruo <wqu@suse.com>
@Conan-Kudo
Copy link
Contributor

Reported also in Fedora: rhbz#2156710

@joshuataylor
Copy link

joshuataylor commented Dec 30, 2022

Sorry to add to this post, but if you use ArchLinux, you can do the following:

It's patched, 🎉, click to view old info
  1. Check what version of btrfs-progs you currently have:
pacman -Qi btrfs-progs | grep Version

Version : 6.1-1.1

  1. For x86_64, download https://archive.archlinux.org/repos/2022/12/20/core/os/x86_64/btrfs-progs-6.0.2-1-x86_64.pkg.tar.zst

Note: This might also be in your /var/cache/pacman/pkg/ directory already.

  1. pacman -U btrfs-progs-6.0.2-1-x86_64.pkg.tar.zst

  2. Open /etc/pacman.conf and add btrfs-progs to IgnorePkg, so it won't be upgraded next time you update using your package manager. When this is fixed, you can simply remove it from ignorepkgs.

It's now patched, as of 6.1-2. :-)

@tdolega
Copy link

tdolega commented Dec 30, 2022

if you use ArchLinux

They patched it now. You can safely upgrade to 6.1-2

@kdave kdave added bug BLOCKER Release blocker labels Jan 2, 2023
@kdave kdave added this to the v6.1.1 milestone Jan 2, 2023
kdave pushed a commit that referenced this issue Jan 2, 2023
…root items

[BUG]
Since commit d729048 ("btrfs-progs: stop using
btrfs_root_item_v0"), "btrfs subvolume list -u" not longer correctly
reports UUID nor timestamp, while older (btrfs-progs v6.0.2) still works
correctly:

 v6.0.2:
 # btrfs subv list -u  /mnt/btrfs/
 ID 256 gen 12 top level 5 uuid ed4af580-d512-2644-b392-2a71aaeeb99e path subv1
 ID 257 gen 13 top level 5 uuid a22ccba7-0a0a-a94f-af4b-5116ab58bb61 path subv2

 v6.1:
 # ./btrfs subv list -u /mnt/btrfs/
 ID 256 gen 12 top level 5 uuid -                                    path subv1
 ID 257 gen 13 top level 5 uuid -                                    path subv2

[CAUSE]
Commit d729048 ("btrfs-progs: stop using btrfs_root_item_v0")
removed old btrfs_root_item_v0, but incorrectly changed the check for
v0 root item.

Now we will treat v0 root items as latest root items, causing possible
out-of-bound access, while treating current root items as older v0 root
items, ignoring the UUID nor timestamp.

[FIX]
Fix the bug by using correct checks, and add extra comments on the
branches.

Issue: #562
Fixes: d729048 ("btrfs-progs: stop using btrfs_root_item_v0")
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
@kdave
Copy link
Owner

kdave commented Jan 2, 2023

Fix pushed to devel. This bug as a high impact so there will be a hotfix release in a few days.

@kdave
Copy link
Owner

kdave commented Jan 3, 2023

v6.1.1 released.

@kdave kdave closed this as completed Jan 3, 2023
@kdave kdave removed the BLOCKER Release blocker label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants