incorrect size for large files due to possible use of 32 bits instead of 64 bits variable

Bug #1930113 reported by Xavier Kral
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fuse-exfat (Ubuntu)
New
Undecided
Unassigned

Bug Description

Large files are reported incorrectly when using the 'ls' command
The expected size should 102G instead, instead it reports 1402M or 2G as if the size was limited to 2G (32 bits).

Example of INCORRECT size:
$ ls -1 -s --block-size=M /mnt/f4/plot-k32-2021-05-08-01-15-1648a669ec6edd5cfb124a1512178c5a2a1a714000f4f52b73efc0c3d91a747c.plot
1402M /mnt/f4/plot-k32-2021-05-08-01-15-1648a669ec6edd5cfb124a1512178c5a2a1a714000f4f52b73efc0c3d91a747c.plot

Example of CORRECT size (same file):
$ ls -l /mnt/f4/plot-k32-2021-05-08-01-15-1648a669ec6edd5cfb124a1512178c5a2a1a714000f4f52b73efc0c3d91a747c.plot
-rwxrwxrwx 1 proxacutor proxacutor 108843801799 May 8 03:39 /mnt/f4/plot-k32-2021-05-08-01-15-1648a669ec6edd5cfb124a1512178c5a2a1a714000f4f52b73efc0c3d91a747c.plot

Extra information:
$ hostnamectl
   Static hostname: aorus
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 9288a1fdec014d6b8579fb3f3965d902
           Boot ID: 4a69a19ea118418c8a05bf21461626e9
  Operating System: Ubuntu 21.04
            Kernel: Linux 5.11.0-17-generic
      Architecture: x86-64

$ dpkg -l | grep exfat
ii exfat-fuse 1.3.0-2 amd64 read and write exFAT driver for FUSE
ii exfat-utils 1.3.0-2 amd64 utilities to create, check, label and dump exFAT filesystem

$ dpkg -l | grep bash
ii bash 5.1-2ubuntu1 amd64 GNU Bourne Again SHell
ii bash-completion 1:2.11-2ubuntu1 all programmable completion for the bash shell

$ mount
/dev/sda1 on /mnt/f4 type exfat (rw,nosuid,nodev,noexec,relatime,uid=1000,gid=1000,fmask=0000,dmask=0000,allow_utime=0022,iocharset=utf8,errors=remount-ro,user)
...

$ cat /etc/fstab
LABEL=F4 /mnt/f4 exfat auto,user,rw,uid=1000,gid=1000,umask=000 0 0
...

$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
└─sda1 exfat 1.0 F4 5E20-EAEC 26.6G 100% /mnt/f4
...

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 11T 11T 27G 100% /mnt/f4
...

Tags: bot-comment
Revision history for this message
Xavier Kral (xavierkral) wrote :

The exact same file has completely different sizes depending on the options used with the 'ls' command. This issue does not happen with XFS, EXT4, ZFS, F2FS and other file systems.

Revision history for this message
Xavier Kral (xavierkral) wrote :

Possible hint:
It seems that the reported/displayed size matches the value of a 64 bits value truncated to 32 bits:

expected dec: 108843801799 (correct)
expected hex: 19 5798 9CC7 (correct)

displayed dec: 1469619399 (incorrect)
displayed hex: 5798 9CC7 (incorrect)

summary: - ls command reports incorrect file size for large files
+ incorrect size for large files due to possible use of 32 bits instead of
+ 64 bits variable
Xavier Kral (xavierkral)
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1930113/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Xavier Kral (xavierkral)
affects: ubuntu → fuse-exfat (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.