GNOME Bugzilla – Bug 669258
Issue relating to reporting of free space
Last modified: 2012-02-09 14:18:54 UTC
I'm using nautilus against a webdav server, and it appears to be reporting the amount of free space on the drive as the amount used, and the amount used as the amount free. Connecting to the same server with the same account using OS/X + Lion with Finder, the user/free numbers are reported correctly. I've tried to look at the source to find out what the code is actually doing, if someone could point me at it I'll certainly try to debug it ...
Can you please provide more info about the WebDav server, so developers could try to reproduce? This might be lower in the stack, like in gvfs or glib's gio.
Ok, I think I found the problem (?) looking at this commit; http://mail.gnome.org/archives/commits-list/2011-May/msg05752.html quota-available-bytes is the free space. quota-used-bytes is the bytes used. G_FILE_ATTRIBUTE_FILESYSTEM_FREE quota-available-bytes, not quota-bytes used. G_FILE_ATTRIBUTE_FILESYSTEM_SIZE should be the sum of the above. .. this this enough, given other clients work fine and looking at this code it does sort of imply it's not a server issue ?? daemon/gvfsbackenddav.c + if (node_has_name (node, "quota-available-bytes")) + { + guint64 size; + + if (! string_to_uint64 (text, &size)) + continue; + + g_file_info_set_attribute_uint64 (info, + G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, + size); + } + else if (node_has_name (node, "quota-used-bytes")) + { + guint64 size; + + if (! string_to_uint64 (text, &size)) + continue; + + g_file_info_set_attribute_uint64 (info, + G_FILE_ATTRIBUTE_FILESYSTEM_FREE, + size); + }
As the problem appears to be with the gfs back-end, have I posted this in the wrong place?
Gareth, thanks for debugging this. Indeed, this bug report belongs to gvfs, changing component. If you have a patch available for the issue, please attach it as a diff file (preferably using git diff or git format-patch) to this report. Thanks!
Hi, I'm afraid I've yet to find a good howto on building and testing the entire GNOME system, so I can't submit a tested patch, however, by eye/hand; daemon/gvfsbackenddav.c -g_file_info_set_attribute_uint64 (info,G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,size); +g_file_info_set_attribute_uint64 (info,G_FILE_ATTRIBUTE_FILESYSTEM_FREE,size); -g_file_info_set_attribute_uint64 (info,G_FILE_ATTRIBUTE_FILESYSTEM_FREE,size); +g_file_info_set_attribute_uint64 (info,G_FILE_ATTRIBUTE_FILESYSTEM_USED,size); If G_FILE_ATTRIBUTE_FILESYSTEM_SIZE is used anywhere else (?) then you'll need a quick check but essentially it needs to be calculated from USED + FREE. If you check the RFC it doesn't deal with 'SIZE' per say, although some of the non- compliant clients implement a 'quote' which would equate to 'size'.
Sorry, "quota" not "quote".
Created attachment 207132 [details] [review] a blind patch The G_FILE_ATTRIBUTE_FILESYSTEM_USED attribute has just been introduced recently and not all applications could understand it yet. I would go the safe way and use the old properties in this case. Gareth, could you please test this patch if possible? I don't have access to quota-aware webdav server, can't test.
Erm, I'm not in a position to build nautilus, unless someone can point me at a howto that's not going to involve a week's worth of setting up. However, if you have a copy built with your patch, try; https://xframe.metro-tek.com/ user: tomas pass: testme99 It has a 1M quota with just a few bytes used ... Checking here I have 0/0 from my nautilus but from the command line using the fuse module I get the correct used/free ... #mount.davfs https://xframe.metro-tek.com/ /mnt #df Filesystem 1K-blocks Used Available Use% Mounted onhttps://xframe.metro-tek.com/ 976560 12 976548 1% /mnt
Great, thanks for providing the testing space, it really helps! Just tested the patch and got the right numbers. Before: > filesystem::size: 999999977 > filesystem::free: 23 After: > filesystem::size: 1000000000 > filesystem::free: 999998623 (In reply to comment #8) > It has a 1M quota with just a few bytes used ... Oh, seeing 1GB quota here, is that correct? Pushed the patch to master: commit 99ae116200691c1dc67ea3fb74060e0d90bf482d Author: Tomas Bzatek <tbzatek@redhat.com> Date: Wed Feb 8 18:53:51 2012 +0100 dav: Fix free space reporting Based on patch by Gareth Bult https://bugzilla.gnome.org/show_bug.cgi?id=669258
Hi, sure, sorry, mixing my M and G .. see the 1k-blocks figure from my davfs listing above ... ;)