[bug #50859] fstype btrfs isn't supported

Brett Milford <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Follow-up Comment #4, bug #50859 (project findutils):

find exhibits the same behavior for me as @tavianator.

I've tracked it to fstype.c:250
if (entry->me_dev == statp->st_dev)

It appears the predicate is never true for me in my test setup and `best` is
never assigned.

~/$ stat -c "%d %n" /mnt/btrfs-test /mnt/btrfs-test/asdfsdaf/subvol/
1048804 /mnt/btrfs-test
1048805 /mnt/btrfs-test/asdfsdaf/subvol/

~/$ df --output=fstype,target /mnt/btrfs-test
/mnt/btrfs-test/asdfsdaf/subvol/
Type  Mounted on
btrfs /mnt/btrfs-test
-     /mnt/btrfs-test/asdfsdaf/subvol

~/$ find /mnt/btrfs-test -printf '%F %p\n'
unknown /mnt/btrfs-test
unknown /mnt/btrfs-test/thing
unknown /mnt/btrfs-test/asdfsdaf
unknown /mnt/btrfs-test/asdfsdaf/asdf
unknown /mnt/btrfs-test/asdfsdaf/subvol

Breakpoint 7, file_system_type_uncached (fstype_known=0x5555555a32b0
<fstype_known>, path=0x7fffffffde80 <incomplete sequence \344>,
statp=0x7fffffffde80) at fstype.c:245
245     in fstype.c
(gdb) p *entry
$14 = {me_devname = 0x5555555af940 "/dev/loop98p1", me_mountdir =
0x5555555af960 "/mnt/btrfs-test", me_mntroot = 0x5555555af980 "/", me_type =
0x5555555af9a0 "btrfs",
  me_dev = 1048793, me_dummy = 0, me_remote = 0, me_type_malloced = 1, me_next
= 0x0}
(gdb) p *statp
$15 = {st_dev = 1048804, st_ino = 260, st_nlink = 1, st_mode = 33204, st_uid =
1000, st_gid = 1000, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 4096,
st_blocks = 0,
  st_atim = {tv_sec = 1617846997, tv_nsec = 768596091}, st_mtim = {tv_sec =
1617846997, tv_nsec = 768596091}, st_ctim = {tv_sec = 1617846997, tv_nsec =
768596091},
  __glibc_reserved = {0, 0, 0}}
(gdb) c
Continuing.
unknown

Breakpoint 7, file_system_type_uncached (fstype_known=0x5555555a32b0
<fstype_known>, path=0x7fffffffde80 <incomplete sequence \345>,
statp=0x7fffffffde80) at fstype.c:245
245     in fstype.c
(gdb) p *entry
$16 = {me_devname = 0x5555555af940 "/dev/loop98p1", me_mountdir =
0x5555555af960 "/mnt/btrfs-test", me_mntroot = 0x5555555af980 "/", me_type =
0x5555555af9a0 "btrfs",
  me_dev = 1048793, me_dummy = 0, me_remote = 0, me_type_malloced = 1, me_next
= 0x0}
(gdb) p *statp
$17 = {st_dev = 1048805, st_ino = 256, st_nlink = 1, st_mode = 16893, st_uid =
1000, st_gid = 1000, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 4096,
st_blocks = 0,
  st_atim = {tv_sec = 1617847022, tv_nsec = 444810726}, st_mtim = {tv_sec =
1617847018, tv_nsec = 344774790}, st_ctim = {tv_sec = 1617847018, tv_nsec =
344774790},
  __glibc_reserved = {0, 0, 0}}

As @berny points out this is likely because of the discussion in
https://savannah.gnu.org/bugs/?50326 ; But I'd like to understand why df can
make this distinction where find can't.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?50859>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.