Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
Upstream report: https://fedorahosted.org/mlocate/ticket/36 signature.asc Description: This is a digitally signed message part.
Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
Same issue reported for openSUSE: https://bugzilla.novell.com/show_bug.cgi?id=994663 Recent versions of openSUSE default to btrfs so they may have a better incentive to fix this problem. Regards, Tristan -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Tristan Miller Free Software developer, ferret herder, logologist https://logological.org/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- signature.asc Description: This is a digitally signed message part.
Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
Hi Tollef, On Sun, May 04, 2014 at 10:51:36AM +0200, Niels Boehm wrote: > Hi Tollef Fog Heen, > > > What does mountinfo look like if you do a bind mount of a subvolume? > > […] Friendly ping. :-) Any updates on this bug? Thanks, Sebastian signature.asc Description: PGP signature
Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
Hi Tollef Fog Heen, > What does mountinfo look like if you do a bind mount of a subvolume? Subvolume /@home mounted on /home: # mount --bind /home/lost+found /tmp/h_a # mount --bind /home/niels/.local /tmp/h_b # mount --bind /tmp/h_b/share /tmp/h_c # egrep @home /proc/self/mountinfo 26 20 0:16 /@home /home rw,relatime - btrfs /dev/sdb3 rw,space_cache 34 20 0:16 /@home/lost+found /tmp/h_a rw,relatime - btrfs /dev/sdb3 rw,space_cache 35 20 0:16 /@home/niels/.local /tmp/h_b rw,relatime - btrfs /dev/sdb3 rw,space_cache 36 20 0:16 /@home/niels/.local/share /tmp/h_c rw,relatime - btrfs /dev/sdb3 rw,space_cache For reference, here's also subvolume /@jessie mounted on /: # mount --bind /bin /tmp/j_a # mount --bind /usr/local /tmp/j_b # mount --bind /tmp/j_b/share /tmp/j_c # egrep @jessie /proc/self/mountinfo 20 1 0:16 /@jessie / rw,relatime - btrfs /dev/sdb3 rw,space_cache 31 20 0:16 /@jessie/bin /tmp/j_a rw,relatime - btrfs /dev/sdb3 rw,space_cache 32 20 0:16 /@jessie/usr/local /tmp/j_b rw,relatime - btrfs /dev/sdb3 rw,space_cache 33 20 0:16 /@jessie/usr/local/share /tmp/j_c rw,relatime - btrfs /dev/sdb3 rw,space_cache > And ditto if you do multiple mounts of the same subvolume (to different > locations)? Subvolume /@home mounted at multiple points: # mount -t btrfs -o subvol=/@home /dev/sdb3 /tmp/s_a # mount -t btrfs -o subvol=/@home /dev/sdb3 /tmp/s_b # egrep @home /proc/self/mountinfo 26 20 0:16 /@home /home rw,relatime - btrfs /dev/sdb3 rw,space_cache 31 20 0:16 /@home /tmp/s_a rw,relatime - btrfs /dev/sdb3 rw,space_cache 32 20 0:16 /@home /tmp/s_b rw,relatime - btrfs /dev/sdb3 rw,space_cache Top (sub)volume / mounted at multiple points: # mount -t btrfs -o subvol=/ /dev/sdb3 /mnt/tmp # mount -t btrfs -o subvol=/ /dev/sdb3 /tmp/t_a # mount -t btrfs -o subvol=/ /dev/sdb3 /tmp/t_b # egrep '0:16 / ' /proc/self/mountinfo 33 20 0:16 / /mnt/tmp rw,relatime - btrfs /dev/sdb3 rw,space_cache 34 20 0:16 / /tmp/t_a rw,relatime - btrfs /dev/sdb3 rw,space_cache 35 20 0:16 / /tmp/t_b rw,relatime - btrfs /dev/sdb3 rw,space_cache Essentially, from a VFS user's point of view, btrfs subvolumes look and behave like bind mounts (apart from requiring different mount options) - they create an additional view into the same filesystem, possibly rooted further down the tree. The root (root of the mount within the filesystem) of mountinfo cascades nicely, even if there are bind mounts on subvolumes. The / root of a particular filesystem (partition) is not guaranteed to be mounted even if deeper levels of the hierarchy are. This is more common for btrfs subvolumes, but in fact also possible for bind mounts. Thanks for your work, Niels Boehm -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
]] Niels Boehm > I'm using 2 btrfs subvolumes, one for / and one for /home. Such > subvolumes (which reside on the same physical partition from a /dev/* > point of view) are presented to the system similar to bind mounts: [...] > The workaround for now is to disable pruning bind mounts. Thanks for the debugging, most useful. I see what the problem is and a possible way to fix it, but to prevent introducing another bug, I need a little more information. What does mountinfo look like if you do a bind mount of a subvolume? And ditto if you do multiple mounts of the same subvolume (to different locations)? Thanks, -- Tollef Fog Heen UNIX is user friendly, it's just picky about who its friends are -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#746943: mlocate is confused by btrfs subvols and doesn't descend into all mount points
Package: mlocate Version: 0.26-1 Severity: normal Dear maintainer, mlocate records files in my /, but not in my /home. I'm using 2 btrfs subvolumes, one for / and one for /home. Such subvolumes (which reside on the same physical partition from a /dev/* point of view) are presented to the system similar to bind mounts: # egrep sdb3 /proc/self/mountinfo 20 1 0:16 /@jessie / rw,relatime - btrfs /dev/sdb3 rw,space_cache 26 20 0:16 /@home /home rw,relatime - btrfs /dev/sdb3 rw,space_cache Running updatedb with --debug-pruning shows that it apparently prunes /home because it thinks it's a bind mount path: # updatedb --debug-pruning ... Rebuilding bind_mount_paths: `/sys' (15 on 20) is `/' of `sysfs' (0:14), type `sysfs' `/proc' (16 on 20) is `/' of `proc' (0:3), type `proc' `/dev' (17 on 20) is `/' of `udev' (0:5), type `devtmpfs' `/dev/pts' (18 on 17) is `/' of `devpts' (0:11), type `devpts' `/run' (19 on 20) is `/' of `tmpfs' (0:15), type `tmpfs' `/' (20 on 1) is `/@jessie' of `/dev/sdb3' (0:16), type `btrfs' `/run/lock' (21 on 19) is `/' of `tmpfs' (0:19), type `tmpfs' `/sys/fs/pstore' (22 on 15) is `/' of `pstore' (0:20), type `pstore' `/run/shm' (23 on 19) is `/' of `tmpfs' (0:21), type `tmpfs' `/sys/fs/fuse/connections' (24 on 15) is `/' of `fusectl' (0:23), type `fusectl' `/boot/efi' (25 on 20) is `/' of `/dev/sda2' (8:2), type `vfat' `/home' (26 on 20) is `/@home' of `/dev/sdb3' (0:16), type `btrfs' `/proc/sys/fs/binfmt_misc' (27 on 16) is `/' of `binfmt_misc' (0:25), type `binfmt_misc' `/sys/fs/cgroup' (29 on 15) is `/' of `none' (0:26), type `tmpfs' `/sys/fs/cgroup/systemd' (30 on 29) is `/' of `systemd' (0:27), type `cgroup' Matching bind_mount_paths: => adding `/home' ...done Checking whether filesystem `/boot/efi' is excluded: ... Skipping `/home': bind mount ... Treating it as a bind mount path is not wrong per se, but it seems to subordinate it to my / (which it doesn't prune), which is wrong. My / and /home have no common mounted root subvol and so should both be scanned. Even if I mount my root subvolume on /mnt/tmp, it doesn't work correctly: # egrep sdb3 /proc/self/mountinfo 20 1 0:16 /@jessie / rw,relatime - btrfs /dev/sdb3 rw,space_cache 26 20 0:16 /@home /home rw,relatime - btrfs /dev/sdb3 rw,space_cache 31 20 0:16 / /mnt/tmp rw,relatime - btrfs /dev/sdb3 rw,space_cache # updatedb --debug-pruning ... Rebuilding bind_mount_paths: `/sys' (15 on 20) is `/' of `sysfs' (0:14), type `sysfs' `/proc' (16 on 20) is `/' of `proc' (0:3), type `proc' `/dev' (17 on 20) is `/' of `udev' (0:5), type `devtmpfs' `/dev/pts' (18 on 17) is `/' of `devpts' (0:11), type `devpts' `/run' (19 on 20) is `/' of `tmpfs' (0:15), type `tmpfs' `/' (20 on 1) is `/@jessie' of `/dev/sdb3' (0:16), type `btrfs' `/run/lock' (21 on 19) is `/' of `tmpfs' (0:19), type `tmpfs' `/sys/fs/pstore' (22 on 15) is `/' of `pstore' (0:20), type `pstore' `/run/shm' (23 on 19) is `/' of `tmpfs' (0:21), type `tmpfs' `/sys/fs/fuse/connections' (24 on 15) is `/' of `fusectl' (0:23), type `fusectl' `/boot/efi' (25 on 20) is `/' of `/dev/sda2' (8:2), type `vfat' `/home' (26 on 20) is `/@home' of `/dev/sdb3' (0:16), type `btrfs' `/proc/sys/fs/binfmt_misc' (27 on 16) is `/' of `binfmt_misc' (0:25), type `binfmt_misc' `/sys/fs/cgroup' (29 on 15) is `/' of `none' (0:26), type `tmpfs' `/sys/fs/cgroup/systemd' (30 on 29) is `/' of `systemd' (0:27), type `cgroup' `/mnt/tmp' (31 on 20) is `/' of `/dev/sdb3' (0:16), type `btrfs' Matching bind_mount_paths: => adding `/home' => adding `/mnt/tmp' ...done Checking whether filesystem `/boot/efi' is excluded: ... Skipping `/home': bind mount Skipping `/media': in prunepaths Skipping `/mnt/tmp': bind mount ... It scans /, but skips /home and /mnt/tmp. I expect it to scan /mnt/tmp (which is subvol /) and skip / and /home (which are subvols /@jessie and /@home, respectively) instead. The workaround for now is to disable pruning bind mounts. Regards Niels Boehm -- System Information: Debian Release: jessie/sid APT prefers testing-proposed-updates APT policy: (930, 'testing-proposed-updates'), (930, 'stable-updates'), (930, 'testing'), (930, 'stable'), (830, 'proposed-updates'), (830, 'stable'), (90, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages mlocate depends on: ii adduser 3.113+nmu3 ii libc62.18-5 mlocate recommends no packages. mlocate suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org