Bug 27194

Summary: gfileinfo returns incorrect file system size and usage.
Product: Mageia Reporter: Dave Hodgins <davidwhodgins>
Component: RPM PackagesAssignee: GNOME maintainers <gnome>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: olav
Version: CauldronKeywords: UPSTREAM
Target Milestone: ---   
Hardware: All   
OS: Linux   
See Also: https://gitlab.gnome.org/GNOME/glib/-/issues/2193
Whiteboard: MGA7TOO
Source RPM: gtk+3.0-3.24.22-1.mga8.src.rpm CVE:
Status comment:

Description Dave Hodgins 2020-08-25 08:17:19 CEST
Looked into why baobab returns incorrect numbers in it's first screen for
file system usage and available. Looking at it's code, it's calling
https://developer.gnome.org/gio/stable/GFileInfo.html#G-FILE-ATTRIBUTE-FILESYSTEM-SIZE:CAPS
to get the information. Running baobab under strace shows gtk GFileInfo is
issuing a statfs call to the kernel to get the info. As per "man statfs",
it should be calling statfs64 due to the larger sizes of files systems now.

I don't see it reported at https://gitlab.gnome.org/groups/GNOME/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=gfileinfo
I don't have a gnome account and new user registrations have been disabled,
so haven't reported it upstream.
Dave Hodgins 2020-08-25 08:18:22 CEST

Whiteboard: (none) => MGA7TOO

Comment 1 Aurelien Oudelet 2020-08-25 08:45:13 CEST
Hi,
Thanks reporting this.
This should be reported upstream.

Assigning meanwhile for monitoring to GNOME Team.

Assignee: bugsquad => gnome
Keywords: (none) => UPSTREAM

Comment 2 Olav Vitters 2020-08-27 16:30:07 CEST
Strange that you couldn't report it upstream. Everyone should be able to file bugs. I'll probably need to file a bug on that as well.

See Also: (none) => https://gitlab.gnome.org/GNOME/glib/-/issues/2193
CC: (none) => olav

Comment 3 Olav Vitters 2020-08-27 16:30:30 CEST
PS: See the "See also" for the bugreport I created on your behalf.
Comment 4 Olav Vitters 2020-08-27 22:39:40 CEST
From upstream:
> On 64-bit architectures, there's no difference between statfs() and statfs64().
> On 32-bit architectures, if GLib was compiled with large file support (-D_FILE_OFFSET_BITS=64), which Meson is meant to do automatically, then a call to statfs() in the source code actually turns into the statfs64 or fstatfs64 system call.

Are you using 64 bit or 32 bit? Assume you know which you have, else paste output of "uname -a" (from a terminal).
Comment 5 Dave Hodgins 2020-08-28 00:02:48 CEST
x86_64 for both the Mageia 7 and Cauldron installs.
Comment 6 Dave Hodgins 2020-08-28 00:13:30 CEST
To give an example of the problem, running baobab as root, my mountpoint
aback shows 38.2GB available, 135.1GB Total.
# df|grep -e ^F -e ^/dev/sda10
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda10      126G   91G   30G  76% /aback

The largest filesystem on this computer is shown by df as having a size of
246GB. It's completely missing from the devices and locations screen of baobab.
It is mounted and has 176GB available according to df.
Comment 7 Olav Vitters 2020-08-28 10:25:05 CEST
(In reply to Dave Hodgins from comment #6)
> To give an example of the problem, running baobab as root, my mountpoint
> aback shows 38.2GB available, 135.1GB Total.
> # df|grep -e ^F -e ^/dev/sda10
> Filesystem      Size  Used Avail Use% Mounted on
> /dev/sda10      126G   91G   30G  76% /aback

Try running:
df --si|grep -e ^F -e ^/dev/sda10

That's probably because loads of things switched to using 1000s instead of 1024
If you calculate 126*1024^3/1000^3 you get 135.3, with some rounding that'll probably is the same as the Baobab 135.1.

Various graphical stuff changed to 1000s because so many things also showed stuff in 1000s.

> The largest filesystem on this computer is shown by df as having a size of
> 246GB. It's completely missing from the devices and locations screen of
> baobab.
> It is mounted and has 176GB available according to df.

Can you run this under gnome-disks. There's some logic in glib/gvfs on if it shows something or if it hides it. I forgot exactly what the logic is, but adding x-gvfs-show as a mount option (in /etc/fstab or by editing the options using gnome-disks) would solve it.
Comment 8 Dave Hodgins 2020-08-28 21:14:47 CEST
Confirmed about the 1000 vs 1024.
# df --si|grep -e ^F -e ^/dev/sda10
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda10      136G   97G   32G  76% /aback

Without any fstab modification or editing, gnome-disks does show the missing
file system.
Size   268 GB — 197 GB free (26.5% full)
Device /dev/sda9
Contents Ext4 (version 1.0) — Mounted at /a9