After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655271 - gvfs does not correctly monitor files on NFS v4 mounted directories.
gvfs does not correctly monitor files on NFS v4 mounted directories.
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-25 15:23 UTC by Jonathan Underwood
Modified: 2014-12-16 17:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathan Underwood 2011-07-25 15:23:04 UTC
For NFS mounted directories, Nautilus doesn't automatically update the contents
of a directory window when the contents of that directory change. Pressing F5
to refresh the window does successfully update the contents.

I opened a nautilus window looking at
my home directory. In one window, I did a gvfs-monitor /home/jgu, and in
another window I ran the following sequence of commands:

touch file
chmod +x file
mv file FILE

Only after the mv command does the file appear in the nautilus window

In the gvfs-monitor window I see:

Directory Monitor Event:
Child = /home/jgu/file
Event = ATTRIB CHANGED
Directory Monitor Event:
Child = /home/jgu/file
Event = CHANGES_DONE_HINT
Directory Monitor Event:
Child = /home/jgu/file
Event = ATTRIB CHANGED
Directory Monitor Event:
Child = /home/jgu/file
Event = DELETED
Directory Monitor Event:
Child = /home/jgu/FILE
Event = CREATED


So, weirdly, the touch file command doesn't seem to trigger a CREATED event in
gvfs.

Also, doing a rm FILE makes the file disappear from the nautilus window, as
expected, and the following appear in the gvfs-monitor window:

Directory Monitor Event:
Child = /home/jgu/FILE
Event = DELETED

Redhat bugzilla report: https://bugzilla.redhat.com/show_bug.cgi?id=725178
Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/gamin/+bug/383118

Incidentally, gamin does successfuly receive file creation events, which (I think) rules out a kernel/nfs4 bug.
Comment 1 Tomas Bzatek 2011-07-25 15:32:33 UTC
I was going to ask earlier... sometimes NFS listings are cached - can you verify by doing "ls -al" that the file is there? (on client side) Preferably test this with freshly mounted filesystem (umount & mount cycle should be fine).
Comment 2 Jonathan Underwood 2011-07-25 16:38:04 UTC
Yes, I can confirm that on the client once I've done a "touch file" that ls -al on both the client and the server shows file as present, but it never appears in Nautilus, and no CREATE event happens.
Comment 3 Jonathan Underwood 2011-07-25 17:15:04 UTC
I find it odd that creating the file does trigger a ATTRIB CHANGED
 event, but not a CREATED event. Suggests the bug is perhaps in one of the GFileMonitor methods. I can't actually work out where they come from though :).
Comment 4 Tomas Bzatek 2011-07-26 12:39:36 UTC
OK, thanks for confirming this. Can you please post your NFS mount options? Are there any symlinks in the path?

Just checked on my machine, I'm getting proper CREATED, ATTRIB CHANGED and CHANGES_DONE_HINT events. We need to find out how this happens.
Comment 5 Jonathan Underwood 2011-07-26 12:50:42 UTC
Thanks for taking a look.

The home directories are actually automounted on login with options

-rsize=8192,wsize=8192,intr,sec=krb5

On the server, they are exported with:

/export   128.40.5.0/24(sec=krb5,fsid=0,rw,nohide,insecure,no_subtree_check,async)
/export/users    128.40.5.0/24(sec=krb5,rw,nohide,insecure,no_subtree_check,async)

Just to re-emphasize, this is all nfs v4 - the ubuntu bug report indicates that this problem doesn't occur with nfs v3.

On the server, /export/users is actually a bind mount:

/storage/users on /export/users type none (rw,bind)

There's nothing symlinked at all (i.e. I can reproduce this with a test account with only the skel files and the directories that Gnome creates on first login).
Comment 6 Jonathan Underwood 2011-07-26 14:19:43 UTC
As another data point if I am at machine A with a nautilus window open looking
at my nfs mounted home directory, and on machine B which also nfs mounts the
home directory when I create and mv a file, it never shows up in nautilus until
I refresh. I realize this is even more of a tricky situation to get right.
Comment 7 Jonathan Underwood 2011-07-26 14:25:24 UTC
Interestingly, installing Thunar 1.3, which I believe uses gio/gvfs, on the same machine does not manifest the problem as originally reported. It does still manifest the more complicated 3 machines scenario in the last comment tho.
Comment 8 Tomas Bzatek 2013-05-15 11:46:02 UTC
There's been NFS monitoring changes in GIO - see bug 592211. Any chance to retest this on recent glib version?
Comment 9 Ross Lagerwall 2014-08-13 20:28:26 UTC
Works for me...
Comment 10 Ondrej Holy 2014-12-16 17:31:59 UTC
It was probably fixed with bug 592211. If you still see this issue, please reopen.