GNOME Bugzilla – Bug 581924
Some apps can't save files to Samba shares because gvfs reports 0 bytes free
Last modified: 2013-10-25 20:31:46 UTC
Please describe the problem: I have several shares on a Samba file server that I use from Windows and Ubuntu clients. The Windows clients all report the available free space correctly. The Ubuntu clients (versions 8.10 and 9.04) always report 0 bytes used and 0 bytes free when I view the connected folder's properties. This effectively makes writing to Samba shares through gvfs a problem. When saving files, some applications just warn about low disk space but others such as Photoshop 7 in Wine just refuse to save files there. The shares tried are both anonymous as well as authenticated. Steps to reproduce: 1. Install Ubuntu 9.04 2. Via the Places menu, choose "Connect to server" and connect to a Samba server. 3.1 After connection, an icon appears on the desktop. Right-click it and show the properties. Then you see "0 bytes used" and "0 bytes free". 3.2 As an example, try Photoshop 7 in Wine, and try to save a file on the share. Actual results: It'll say there's not enough space left and refuse to save. It's all up to the applications on how they react to the "0 bytes free" problem. I've experienced this problem in other apps too but I can't recall which (I think Gnome Commander when copying). Expected results: Being able to save a file on a Windows share. Does this happen every time? Yes. I've experienced it on 2 PC's (Ubuntu 8.10 and Ubuntu 9.04) and with a VirtualBox Ubuntu 9.04 vm. Other information:
Windows XP clients report the free disk space on the shares correctly. It's just the Linux clients that are having this trouble.
Created attachment 134280 [details] Screenshot of properties dialog.
As another example, I just tried Gnome Commander. As soon as I enter the ~/.gvfs directory GC shows "0 bytes free" and it stays that way no matter which connected share I navigate to. Then when I try to copy a file to the writeable share, GC shows an error dialog with "No space left on device". Total Commander in Windows XP on the other hand shows the correct free disk space when I navigate to same share and allows copying.
same with ktorrent - unable to download files into .gvfs folders.
I've implemented getting file system size and free space information in the smb backend, so that information should be propagated when it's available (at least in native GIO clients such as Nautilus). Availability depens on your system libsmbclient version (3.4.0 is required) and support on the smb server side (older samba 3.0 servers have issues with that). Included in gvfs-1.4.3 and gvfs-1.5.2. The fuse daemon still lacks this support, to be implemented. This zero-space issue in fuse mount is not limited just to SMB, other backend don't provide this information either (and very often they even can't). Then, every statvfs() call would return zeroes. Returning fake numbers might be an option but not for everyone.
FYI, just found the statfs call implemented but disabled with the following comment: /* 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. */
If I understand correctly, according to what is written above and to https://bugs.launchpad.net/gvfs/+bug/373477/comments/21 to 24, it seems this problem was fixed at some point. However, in Ubuntu 10.04, which uses gvfs 1.60, I still face this problem (Nautilus reports 0 bytes free on an smb mounted disk with gvfs, and some applications complain about disk full when trying to write to it). Is that a regression introduced after the above fix? I reported this in https://bugs.launchpad.net/gvfs/+bug/373477/comments/27, but I figure it might be more appropriate and reactive here.
I have a fresh install of Ubuntu 11.04, and the problem remains, nothing is fixed, at least for me... https://bugs.launchpad.net/gvfs/+bug/373477/
(In reply to comment #7) > However, in Ubuntu 10.04, which uses gvfs 1.60, I still face this problem > (Nautilus reports 0 bytes free on an smb mounted disk with gvfs, and some > applications complain about disk full when trying to write to it). (In reply to comment #8) > I have a fresh install of Ubuntu 11.04, and the problem remains, nothing is > fixed, at least for me... Can you give me more information like what type and version of SMB server are you connecting to? Also libsmbclient library version is important here. And output of gvfs-info on the mount would be useful. I would expect applications going through the fuse mount to fail at some point but not Nautilus.
Server machine: ii samba 2:3.5.8~dfsg-1ubuntu2.2 ii samba-common 2:3.5.8~dfsg-1ubuntu2.2 ii samba-common-bin 2:3.5.8~dfsg-1ubuntu2.2 ii libsmbclient 2:3.5.8~dfsg-1ubuntu2.2 ii python-smbc 1.0.10-0ubuntu1 ii smbclient 2:3.5.8~dfsg-1ubuntu2.2 ii smbfs 2:4.5-2 Client machine: ii libsmbclient 2:3.5.8~dfsg-1ubuntu2.2 ii smbclient 2:3.5.8~dfsg-1ubuntu2.2 ii samba-common 2:3.5.8~dfsg-1ubuntu2.2 ii samba-common-bin 2:3.5.8~dfsg-1ubuntu2.2 gvfs-info ~/.gvfs/download\ on\ del/ display name: download on del edit name: / name: / type: directory size: 0 attributes: standard::type: 2 standard::name: / standard::display-name: download on del standard::edit-name: / standard::icon: folder-remote standard::content-type: inode/directory standard::size: 0 etag::value: 1310961865 id::filesystem: smb-share:server=del,share=download time::modified: 1310961865 time::modified-usec: 0 time::access: 1311327994 time::access-usec: 0 time::changed: 1310961865 time::changed-usec: 0 unix::device: 8808 unix::inode: 1263482 metadata::annotation: metadata::nautilus-list-view-sort-column: name metadata::nautilus-list-view-sort-reversed: false gvfs-info ~/.gvfs/del2/ display name: zarko on del edit name: / name: / type: directory size: 0 attributes: standard::type: 2 standard::name: / standard::display-name: zarko on del standard::edit-name: / standard::icon: folder-remote standard::content-type: inode/directory standard::size: 0 etag::value: 1311332174 id::filesystem: smb-share:server=del,share=zarko time::modified: 1311332174 time::modified-usec: 0 time::access: 1311332189 time::access-usec: 0 time::changed: 1311332174 time::changed-usec: 0 unix::device: 1478 unix::inode: 1277511 metadata::annotation: metadata::nautilus-list-view-sort-column: name metadata::nautilus-list-view-sort-reversed: false
Additional info: copying from Nautilus works, displaying amount of free space also works, but from anything else (midnight commander, for example) doesn't. I never liked Nautilus-like file managers, I'm a commander user (midnight, double, etc). And, here is my mini-script that executes on login and mounts shares from server: #!/bin/bash gvfs-mount smb://del/download gvfs-mount smb://del/zarko I guess that's all gvfs-related stuff I have on my machine...
OK, I have various configurations that behave differently: ##########################################" 1- At home, I have a standalone headless NAS which is a few years old and ubuntu 11.04 64bit clients If I mount the NAS in my clients with gvfs, and ask about the NAS's "properties" in Nautilus, it says "free space : unknown; 0 bytes used; 0 bytes free; total capacity: 0 bytes" As a consequence, from these ubuntu clients some apps (LibreOffice, notably) fail to write files to that gvfs-mounted NAS. Therefore I mount it in fstab, no big deal at home. On the NAS side there are two samba versions installed, not sure which is running, though. samba - 3.0.28-2 - Samba suite provides file and print services to SMB/CIFS clients. samba2 - 2.2.12-1 - Lightweight Samba suite provides file and print services to SMB/CIFS clients. On my up-to-date Ubuntu 11.04 clients : samba-common 2:3.5.8~dfsg-1ubuntu2.2 samba-common-bin 2:3.5.8~dfsg-1ubuntu2.2 libsmbclient 2:3.5.8~dfsg-1ubuntu2.2 python-smbc/natty uptodate 1.0.10-0ubuntu1 smbclient 2:3.5.8~dfsg-1ubuntu2.2 gvfs-info: display name: myshare on myserver edit name: / name: / type: directory size: 0 attributes: standard::type: 2 standard::name: / standard::display-name: myshare on myserver standard::edit-name: / standard::icon: folder-remote standard::content-type: inode/directory standard::size: 0 etag::value: 1287601004 id::filesystem: smb-share:server=myserver,share=myshare,user=XXXX time::modified: 1287601004 time::modified-usec: 0 time::access: 1307270741 time::access-usec: 0 time::changed: 1287601004 time::changed-usec: 0 unix::device: 7434 unix::inode: 945726 metadata::annotation: metadata::nautilus-icon-view-auto-layout: true metadata::nautilus-icon-view-tighter-layout: false ######################################## 2- At work I have several Ubuntu machines accessing windows machines. Ubuntu versions <= 10.04 have the "no free space" problem on all these windows machines. I also have a newer 11.04 64bit install (same packages as above) for which gvfs works (Nautilus displays free space, I have read-write access from LibreOffice). So this is really a huge improvement, thanks for the good work! Let me know if you need more information
(In reply to comment #12) > If I mount the NAS in my clients with gvfs, and ask about the NAS's > "properties" in Nautilus, it says "free space : unknown; 0 bytes used; 0 bytes > free; total capacity: 0 bytes" Yes, that's correct, we don't set fsinfo when we're unable to get it properly. Nautilus and native GIO apps should be working correctly. > As a consequence, from these ubuntu clients some apps (LibreOffice, notably) > fail to write files to that gvfs-mounted NAS. Going through fuse daemon I would expect some apps to fail - comment 6 still stands. This shouldn't be limited to SMB, other protocol mounts should fail the same way. > 2- At work I have several Ubuntu machines accessing windows machines. Ubuntu > versions <= 10.04 have the "no free space" problem on all these windows > machines. I also have a newer 11.04 64bit install (same packages as above) for > which gvfs works (Nautilus displays free space, I have read-write access from > LibreOffice). So this is really a huge improvement, thanks for the good work! Cool, thanks for confirmation.
Just filed bug 655401 for the fuse case, please test the patch inside.
gvfs correctly sets the free space for samba shares (both recent Windows and recent Samba Linux servers). This information can be accessed with gvfs-info -f and/or the fuse daemon. If this is still an issue with some servers, it is likely a problem with the server or libsmbclient. Anyway, that should become a new issue...