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 760159 - Invalidate ftp dir cache on write close
Invalidate ftp dir cache on write close
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: ftp backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2016-01-05 12:49 UTC by Ondrej Holy
Modified: 2016-02-09 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ftp: Invalidate dir cache on write close (2.27 KB, patch)
2016-01-05 12:49 UTC, Ondrej Holy
none Details | Review
ftp: Invalidate dir cache on write close (2.49 KB, patch)
2016-02-09 11:28 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2016-01-05 12:49:13 UTC
Created attachment 318252 [details] [review]
ftp: Invalidate dir cache on write close

Wrong file size is returned if query_info is executed during write operation, because dir cache is invalidated on open_for_write. Wrong file size might cause POSIX editors fails to read file content over fuse daemon. Invalidate the cache also on close_write.

The bug was found, when I was debugging following issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1295007
Comment 1 Ondrej Holy 2016-02-09 10:26:02 UTC
Review of attachment 318252 [details] [review]:

I have made an addition testing and realized that the cache has to be invalidated, after the connection is already closed...
Comment 2 Ondrej Holy 2016-02-09 11:28:21 UTC
Created attachment 320700 [details] [review]
ftp: Invalidate dir cache on write close

So I have sightly modified the patch...

Without patch:
$ gvfs-save ftp://HOST/FILE < FILE & gvfs-info ftp://HOST/FILE | grep ^size
[1] PID
size:  0
[1]+  Done   
$ gvfs-info ftp://HOST/FILE | grep ^size
size:  0

With patch:
$ echo SOMECONTENT | gvfs-save ftp://HOST/FILE < FILE & gvfs-info ftp://HOST/FILE | grep ^size
[1] PID
size:  0
[1]+  Done   
$ gvfs-info ftp://HOST/FILE | grep ^size
size:  FILESIZE
Comment 3 Ondrej Holy 2016-02-09 11:30:56 UTC
Comment on attachment 320700 [details] [review]
ftp: Invalidate dir cache on write close

master:
commit b161a2b4a7cf3b9f525caf26206df92d451fcb39

gnome-3-18:
commit ea78c2bf2fdd357d69c50a66eb664cde76beb1b6