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 626767 - filesystem::{free,size,used} not set for full FAT fs
filesystem::{free,size,used} not set for full FAT fs
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-08-12 19:01 UTC by Pedro Villavicencio
Modified: 2018-05-24 12:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30



Description Pedro Villavicencio 2010-08-12 19:01:50 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/nautilus/+bug/485426

"when adding music to my ipod shuffle I discovered if rhythmbox manages to fill all the free space on the ipod, the disk usage numbers suddenly default to all zeros. so the property's menu will read disk free space as 0 and used space as 0. this also shows the same way in nautilus's property's menu, so it seams to be a bug in nautilus. I also found that if I deleted a single song to free up 1mb the disk usage amounts would return to normal and read the correct amount used and volume size. so far i have only tested my ipod shuffle, but it may effect all volumes."

"I first ran across this bug while using rhythmbox with my ipod shuffle, but it seems to be a nautilus bug that effects all volumes. i was able to cause this bug to happen on one of my flash drives yesterday. as far as i know both the ipod shuffle and the flash drive use the FAT file system. so it may be limited to just FAT file systems. this bug seems to happen when you fill all available space on a partition. to cause this on a flash drive i just had to use all available kilobytes on the flash drive."

gvfs-mount -li log:

"Drive(2): Apple iPod
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sdg'
  themed icons:  [multimedia-player-apple-ipod]  [multimedia-player-apple]  
[multimedia-player]  [multimedia]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=1
  can_eject=1
  can_start=0
  can_stop=1
  start_stop_type=shutdown
  Volume(0): USER'S IPOD
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     uuid: '44C2-D992'
     unix-device: '/dev/sdg'
     label: 'USER'S IPOD'
    themed icons:  [multimedia-player-apple-ipod]  [multimedia-player-apple]  
[multimedia-player]  [multimedia]
    can_mount=1
    can_eject=1
    should_automount=0
    Mount(0): USER'S IPOD -> file:///media/USER'S%20IPOD
      Type: GProxyMount (GProxyVolumeMonitorGdu)
      default_location=file:///media/USER'S%20IPOD
      themed icons:  [multimedia-player-apple-ipod]  [multimedia-player-apple]  
[multimedia-player]  [multimedia]
      x_content_types: x-content/audio-player
      can_unmount=1
      can_eject=1
      is_shadowed=0
"

udisks --dump:

"Showing information for /org/freedesktop/UDisks/devices/sdg
  native-path: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3.1/1-3.1:1.0/host6/target6:0:0/6:0:0:0/block/sdg
  device: 8:96
  device-file: /dev/sdg
    presentation: /dev/sdg
    by-id: /dev/disk/by-id/usb-Apple_iPod_000A2700114DC7E9-0:0
    by-id: /dev/disk/by-uuid/44C2-D992
    by-path: /dev/disk/by-path/pci-0000:00:1d.7-usb-0:3.1:1.0-scsi-0:0:0:0
  detected at: Fri 23 Apr 2010 06:22:39 AM EDT
  system internal: 0
  removable: 1
  has media: 1 (detected at Fri 23 Apr 2010 06:22:39 AM EDT)
    detects change: 1
    detection by polling: 1
    detection inhibitable: 1
    detection inhibited: 0
  is read only: 0
  is mounted: 1
  mount paths: /media/USER'S IPOD
  mounted by uid: 1000
  presentation hide: 0
  presentation nopolicy: 0
  presentation name:
  presentation icon: multimedia-player-apple-ipod
  size: 1015021568
  block size: 2048
  job underway: no
  usage: filesystem
  type: vfat
  version: FAT32
  uuid: 44C2-D992
  label: USER'S IPOD
  drive:
    vendor: Apple
    model: iPod
    revision: 2.70
    serial: 000A2700114DC7E9
    WWN:
    detachable: 1
    can spindown: 0
    rotational media: Yes, unknown rate
    write-cache: unknown
    ejectable: 0
    adapter: Unknown
    ports:
    similar devices:
    media:
      compat:
    interface: usb
    if speed: 480000000 bits/s
    ATA SMART: not available"

screenshot:

http://launchpadlibrarian.net/36090060/ipod%20properties.png

Is this more like a gvfs issue? Thanks.
Comment 1 Cosimo Cecchi 2010-08-14 10:41:54 UTC
-> gvfs

The fact that both rhythmbox and nautilus are consistent in displaying the wrong information makes me think this is actually a gvfs bug.
Comment 2 Ross Lagerwall 2013-12-09 16:38:43 UTC
The problem is in glib/gio/glocalfile.c:
  /* Many backends can't report free size (for instance the gvfs fuse
     backend for backend not supporting this), and set f_bfree to 0,
     but it can be 0 for real too. We treat the available == 0 and
     free == 0 case as "both of these are invalid".
   */

For a FAT filesystem, f_bavail and f_bfree are the same so when it fills up, the sizes are treated as invalid and are not filled in.

To trivally reproduce it, plug in a flash drive:
$ gvfs-info -f /run/media/ross/LIVE/
attributes:
  filesystem::size: 2024497152
  filesystem::free: 137035776
  filesystem::type: msdos
  filesystem::used: 1887461376

$ dd if=/dev/zero bs=4M of=/dev/disk/by-id/<flash-drive>

$ gvfs-info -f /run/media/ross/LIVE/
attributes:
  filesystem::type: msdos



The fact that it happened with an iPod is because the iPod appears as a FAT filesystem.
Comment 3 GNOME Infrastructure Team 2018-05-24 12:34:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/328.