+++ This bug was initially created as a clone of Bug #501848 +++
--- Additional comment from kdudka on 2009-10-21 14:27:51 EDT ---
Reported upstream:
http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00207.html
--- Additional comment from kdudka on 2009-10-31 09:13:44 EDT ---
(In reply to comment #42)
> What event triggers the mount?
From my observation with gdb:
1. calling fstatat() with AT_SYMLINK_NOFOLLOW does NOT trigger the mount.
2. calling fstatat() without AT_SYMLINK_NOFOLLOW triggers the mount, opening a directory as well.
If you are asking which events are guaranteed to trigger the mount and/or which events are guaranteed to NOT trigger the mount, kernel guys might give you a reliable answer.
Jeff, any idea?
--- Additional comment from jlayton on 2009-11-02 14:01:06 EDT ---
Submounts are triggered via the follow_link inode operation, so in some ways these are treated like symlinks...
The short answer is that the mount will be triggered whenever you walk a path in such a way that, if this component were a symlink it would be resolved to its target.
Longer answer:
If the place where you transition into a new filesystem is in the middle of a path, then generally the path will be resolved. If it's the last component of the path, then it depends on whether the LOOKUP_FOLLOW link flag is set in nameidata in the kernel. That varies with the type of operation -- for instance, lstat() won't have that set, but a "normal" stat() generally will.
--- Additional comment from kdudka on 2009-11-03 07:41:30 EDT ---
Minimal example which works reliably on my Fedora 11 installation:
# mount | grep ^/
/dev/sda1 on / type ext3 (rw)
/dev/sda3 on /home type ext4 (rw)
# ls -d /home/test
/home/test
# printf "/ *(fsid=0,crossmnt)\n/home *(crossmnt)\n" \
> /etc/exports
# service nfs restart
# mkdir /tmp/mnt
# mount -t nfs4 localhost:/ /tmp/mnt \
&& stat --printf "%d\t%i\t%n\n" /tmp/mnt/home \
&& stat --printf "%d\t%i\t%n\n" /tmp/mnt/home/test \
&& stat --printf "%d\t%i\t%n\n" /tmp/mnt/home
29 2 /tmp/mnt/home
30 12 /tmp/mnt/home/test
30 2 /tmp/mnt/home
--- Additional comment from kdudka on 2009-11-03 15:22:57 EDT ---
A patch for gnulib proposed upstream:
http://lists.gnu.org/archive/html/bug-gnulib/2009-11/msg00027.html
--- Additional comment from meyering on 2009-11-04 15:07:51 EDT ---
FYI, I've (re)raised the issue on LKML:
http://lkml.org/lkml/2009/11/4/451
Comment 1Fedora Update System
2009-11-18 19:01:31 UTC
Comment 2Fedora Update System
2009-11-20 05:29:15 UTC
findutils-4.4.2-5.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update findutils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11813
Comment 3Fedora Update System
2009-12-26 19:54:14 UTC
findutils-4.4.2-6.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.