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 655401 - fuse: Bring back real statfs()
fuse: Bring back real statfs()
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: fuse
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-27 10:14 UTC by Tomas Bzatek
Modified: 2011-08-15 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (3.50 KB, patch)
2011-07-27 10:20 UTC, Tomas Bzatek
committed Details | Review

Description Tomas Bzatek 2011-07-27 10:14:52 UTC
Despite of the following comment in the sources, vfs_statfs() is properly called with a path from inside the mount. This is with 2.6.38 kernel and fuse-2.8.5.

/* A stat -f <path> on a FUSE mount always results in this function being called
   with a path of '/'. This means we can't return valid info for the various
   mounts. Hopefully we can fix this in the future. */

Looking at fuse changelog, this should be supported since 2.6.0-rc1 and kernel 2.6.19:

2006-08-18  Miklos Szeredi <miklos@szeredi.hu>

        * For linux kernels >=2.6.18 (2.6.19 if using the fuse module from
        the kernel tree) the statfs method will receive the path within
        the filesystem on which the stat(v)fs syscall was called

Looking at gvfs configure.ac, we require fuse >= 2.8.0 anyway. So I think we can peacefully bring real statfs support back.
Comment 1 Tomas Bzatek 2011-07-27 10:20:22 UTC
Created attachment 192744 [details] [review]
proposed patch

Patch that implements full statvfs() functionality. We fall back to zero values just like we did before, for fuse mount root and for filesystems that don't provide necessary info. For non-existent paths we return proper error.

Please test, especially with LibreOffice on SMB.
Comment 2 Tomas Bzatek 2011-08-15 16:22:29 UTC
I went ahead and committed the patch. It got some testing in Fedora for a little time with no reported bugs so far.

commit 314b991948fd4d6e9ea84a889e4c84fa79f0965d
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:   Mon Aug 15 18:19:42 2011 +0200

    fuse: Bring back real statfs()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655401