Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* bizare bug in "btrfs subvolume show"
@ 2020-11-14  5:47 Lawrence D'Anna
  2020-11-14  7:28 ` Chris Murphy
  2020-11-14 21:35 ` Lawrence D'Anna
  0 siblings, 2 replies; 9+ messages in thread
From: Lawrence D'Anna @ 2020-11-14  5:47 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Meghan Gwyer

Hi btrfs folks.

I’m encountering what looks like a very strange bug in btrfs-progs or possibly btrfs itself.

If i just do subvol show in a terminal, it works

root@odin:/home/lawrence_danna/src/btrfs-progs# btrfs subvol show /data/
/
        Name:                   <FS_TREE>
        UUID:                   853d0925-fafc-4b69-9efa-b970fb93a419
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2020-09-28 22:44:37 -0700
        Subvolume ID:           5
        Generation:             56582
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Snapshot(s):


but if I redirect standard out, it fails!

root@odin:/home/lawrence_danna/src/btrfs-progs# btrfs subvol show /data/ >/dev/null 
ERROR: Subvolume not found: No such file or directory

same result if I redirect to a file, or pipe it to cat

I can see in a debugger that the error causing the message is being returned from here, 
in get_subvolume_info_privileged() in subvolume.c

            ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &search);
            if (ret == -1)
                return BTRFS_UTIL_ERROR_SEARCH_FAILED;
            items_pos = 0;
            buf_off = 0;

            if (search.key.nr_items == 0) {
                if (need_root_item) {
                    errno = ENOENT;
                    return BTRFS_UTIL_ERROR_SUBVOLUME_NOT_FOUND;  /* HERE */
                } else {
                    break;
                }
            }

But I haven’t been able to track down how redirecting the standard out is possibly influencing this.

Has anyone seen this before or have a clue what might be going on?

Thanks for the help.



system info:

root@odin:/home/lawrence_danna/src/btrfs-progs# uname -a
Linux odin 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

root@odin:/home/lawrence_danna/src/btrfs-progs# btrfs --version
btrfs-progs v5.4.1 

root@odin:/home/lawrence_danna/src/btrfs-progs# btrfs fi show /data/
Label: 'odin-data-2'  uuid: aa5c45da-a789-44fe-825d-9b33f81c9db3
        Total devices 4 FS bytes used 4.12TiB
        devid    1 size 7.28TiB used 2.06TiB path /dev/sdd
        devid    2 size 7.28TiB used 2.06TiB path /dev/sdc
        devid    3 size 7.28TiB used 2.06TiB path /dev/sdb
        devid    4 size 7.28TiB used 2.06TiB path /dev/sda

root@odin:/home/lawrence_danna/src/btrfs-progs# btrfs fi df /data/
Data, RAID10: total=3.84TiB, used=3.83TiB
System, RAID10: total=64.00MiB, used=528.00KiB
Metadata, RAID10: total=292.00GiB, used=291.16GiB
GlobalReserve, single: total=512.00MiB, used=0.00B

root@odin:/home/lawrence_danna/src/btrfs-progs# lsb_release -rd
Description:    Ubuntu 20.04.1 LTS
Release:        20.04

root@odin:/home/lawrence_danna/src/btrfs-progs# dpkg -l btrfs-progs
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-===============================================
ii  btrfs-progs    5.4.1-2      amd64        Checksumming Copy on Write Filesystem utilities







^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-18  1:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-14  5:47 bizare bug in "btrfs subvolume show" Lawrence D'Anna
2020-11-14  7:28 ` Chris Murphy
2020-11-14 18:29   ` Lawrence D'Anna
2020-11-14 21:35 ` Lawrence D'Anna
2020-11-15  9:53   ` Roman Mamedov
2020-11-16  2:09     ` Lawrence D'Anna
2020-11-16 20:31       ` Goffredo Baroncelli
2020-11-16 20:51         ` Lawrence D'Anna
2020-11-18  1:17           ` Lawrence D'Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox