! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar free space calculation incorrect on Solaris
Status:
RESOLVED: WONTFIX
Product:
Thunar-vfs
Component:
General

Comments

Description Peter Tribble 2009-07-12 10:57:06 CEST
On my machine, the Free space reported by Thunar is clearly incorrect.

Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d10         24G    12G    11G    54%    /
/dev/dsk/c2d0s7        174G    54G   118G    32%    /export

and yet Thunar reports 88G Free on / and 945G free on /export.

Looking at thunar-vfs/thunar-vfs-io-local.c, the problem appears to be that it's assuming that the size calculation is done in units of f_bsize rather than f_frsize. Hence a factor 8. So a fix for Solaris is:

====================
--- thunar-vfs/thunar-vfs-io-local.c.orig       Mon Jan 12 20:38:49 2009
+++ thunar-vfs/thunar-vfs-io-local.c    Sun Jul 12 11:48:47 2009
@@ -219,7 +219,7 @@

   /* return the free space */
   if (G_LIKELY (succeed && free_space_return != NULL))
-    *free_space_return = ((ThunarVfsFileSize) statfsb.f_bavail * (ThunarVfsFileSize) statfsb.f_bsize);
+    *free_space_return = ((ThunarVfsFileSize) statfsb.f_bavail * (ThunarVfsFileSize) statfsb.f_frsize);

   return succeed;
 }
====================

However, I have no access to any other OS to verify behaviour there. All I can say is, on Solaris 10, use f_frsize rather than f_bsize.
Comment 1 Ken Mays 2011-10-09 02:34:39 CEST
Tested the same patch on Oracle Solaris 11 for Thunar-vfs 1.2.0:

--- thunar-vfs-1.2.0/thunar-vfs/thunar-vfs-io-local.c.old       2011-10-09 01:10
:22.024674206 +0100
+++ thunar-vfs-1.2.0/thunar-vfs/thunar-vfs-io-local.c   2011-10-09 01:11:24.9966
57675 +0100
@@ -219,7 +219,7 @@ _thunar_vfs_io_local_get_free_space (con

   /* return the free space */
   if (G_LIKELY (succeed && free_space_return != NULL))
-    *free_space_return = ((ThunarVfsFileSize) statfsb.f_bavail * (ThunarVfsFile
Size) statfsb.f_bsize);
+    *free_space_return = ((ThunarVfsFileSize) statfsb.f_bavail * (ThunarVfsFile
Size) statfsb.f_frsize);

   return succeed;
 }

Tested and compiles clean for Oracle Solaris 11/OpenSolaris-based platforms.
Comment 2 Nick Schermer editbugs 2014-12-03 09:19:13 CET
Close bug reports of archived products.

Bug #5561

Reported by:
Peter Tribble
Reported on: 2009-07-12
Last modified on: 2014-12-03

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information