Public bug reported:

my environment: Ubuntu 22.04LTS with ext4 filesystem and extent maps

find(1) utility has a value for sparseness.
I wanted to understand the extent mapping and focused on files with sparseness 
< 1.0
I have a shell script for filtering to "0.99" sparseness.
I use this file with "dd"
e.g.
root@prod:/home/bernie22# dd bs=512 if=/usr/lib/locale/locale-archive 
of=/dev/null
11855+1 records in
11855+1 records out
6070224 bytes (6,1 MB, 5,8 MiB) copied, 0,0214176 s, 283 MB/s

next is a test c source code for statx(2)
root@prod:/home/bernie22# bin/test-statx /usr/lib/locale/locale-archive
statx(/usr/lib/locale/locale-archive) = 0
results=1fff (stx_blocks is mask 0x400U)
  Size: 6070224         Blocks: 11784      IO Block: 4096    regular file
Device: 08:06           Inode: 132054      Links: 1    
Access: (0644/-rw-r--r--)  Uid:     0   Gid:     0
Access: 2026-01-04 19:13:05.892648968+0100
Modify: 2025-09-23 08:15:00.123602960+0200
Change: 2025-09-23 08:15:00.123602960+0200
 Birth: 2025-09-23 08:14:18.109533887+0200
Attributes: 0000000000000000 (........ ........ ........ ........ ........ 
..--.... ..---... .---.-..)

Note: the block difference between "dd" and statx(2) return. the
statx(2) mask stx_mask reports a correcly filled in stx_blocks value

root@prod:/home/bernie22# filefrag -sv /usr/lib/locale/locale-archive
Filesystem type is: ef53
File size of /usr/lib/locale/locale-archive is 6070224 (1482 blocks of 4096 
bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..       2:    6175232..   6175234:      3:            
   1:        4..       5:    6175236..   6175237:      2:            
   2:       15..     511:    6175247..   6175743:    497:            
   3:      512..     831:    5596672..   5596991:    320:    6175744:
   4:      832..     833:    5571130..   5571131:      2:    5596992:
   5:      834..    1466:    5580506..   5581138:    633:    5571132:
   6:     1467..    1467:    5571241..   5571241:      1:    5581139:
   7:     1468..    1468:    5571283..   55712root@prod:/home/bernie22# 
filefrag -sv /usr/lib/locale/locale-archive
Filesystem type is: ef53
File size of /usr/lib/locale/locale-archive is 6070224 (1482 blocks of 4096 
bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..       2:    6175232..   6175234:      3:            
   1:        4..       5:    6175236..   6175237:      2:            
   2:       15..     511:    6175247..   6175743:    497:            
   3:      512..     831:    5596672..   5596991:    320:    6175744:
   4:      832..     833:    5571130..   5571131:      2:    5596992:
   5:      834..    1466:    5580506..   5581138:    633:    5571132:
   6:     1467..    1467:    5571241..   5571241:      1:    5581139:
   7:     1468..    1468:    5571283..   5571283:      1:    5571242:
   8:     1469..    1469:    5571242..   5571242:      1:    5571284:
   9:     1470..    1471:    5571280..   5571281:      2:    5571243:
  10:     1472..    1473:    5571318..   5571319:      2:    5571282:
  11:     1474..    1474:    5571243..   5571243:      1:    5571320:
  12:     1475..    1476:    5571482..   5571483:      2:    5571244:
  13:     1477..    1480:    5571132..   5571135:      4:    5571484:
  14:     1481..    1481:    5571172..   5571172:      1:    5571136: last,eof
/usr/lib/locale/locale-archive: 13 extents found
83:      1:    5571242:
   8:     1469..    1469:    5571242..   5571242:      1:    5571284:
   9:     1470..    1471:    5571280..   5571281:      2:    5571243:
  10:     1472..    1473:    5571318..   5571319:      2:    5571282:
  11:     1474..    1474:    5571243..   5571243:      1:    5571320:
  12:     1475..    1476:    5571482..   5571483:      2:    5571244:
  13:     1477..    1480:    5571132..   5571135:      4:    5571484:
  14:     1481..    1481:    5571172..   5571172:      1:    5571136: last,eof
/usr/lib/locale/locale-archive: 13 extents found

Note: last line tells 13 extents, I see index ZERO up to 14 = 15 extents
adding up the length column gets 1472 blocks.
dividing the byte value by 4096 gives 1481.9883
1482 blocks times 8 gives 11856 blocks a 512 Bytes

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: linux-image-6.8.0-90-generic 6.8.0-90.91~22.04.1
ProcVersionSignature: Ubuntu 6.8.0-90.91~22.04.1-generic 6.8.12
Uname: Linux 6.8.0-90-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.10
Architecture: amd64
AudioDevicesInUse:
 USER        PID ACCESS COMMAND
 /dev/snd/controlC0:  bernie     1638 F.... wireplumber
 /dev/snd/seq:        bernie     1636 F.... pipewire
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Jan  5 18:46:13 2026
InstallationDate: Installed on 2022-05-31 (1315 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
IwConfig:
 lo        no wireless extensions.
 
 enp0s25   no wireless extensions.
MachineType: Hewlett-Packard HP EliteBook 8560p
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-6.8.0-90-generic 
root=UUID=8c4a19fc-3a52-45a8-af0a-5ab87347db3a ro loglevel=5 nosmt noplymouth 
security_lockdown_lsm_early lockdown=confidentiality ipv6.disable=1 
initcall_blacklist=serial8250_init
RelatedPackageVersions:
 linux-restricted-modules-6.8.0-90-generic N/A
 linux-backports-modules-6.8.0-90-generic  N/A
 linux-firmware                            20220329.git681281e4-0ubuntu3.40
RfKill:
 
SourcePackage: linux-hwe-6.8
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/06/2017
dmi.bios.release: 15.101
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 68SCF Ver. F.65
dmi.board.name: 1618
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 97.4E
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.ec.firmware.release: 151.78
dmi.modalias: 
dmi:bvnHewlett-Packard:bvr68SCFVer.F.65:bd04/06/2017:br15.101:efr151.78:svnHewlett-Packard:pnHPEliteBook8560p:pvrA0001D02:rvnHewlett-Packard:rn1618:rvrKBCVersion97.4E:cvnHewlett-Packard:ct10:cvr:skuLG731EA#ABD:
dmi.product.family: 103C_5336AN
dmi.product.name: HP EliteBook 8560p
dmi.product.sku: LG731EA#ABD
dmi.product.version: A0001D02
dmi.sys.vendor: Hewlett-Packard

** Affects: linux-hwe-6.8 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2137491

Title:
  syscall statx(2) report wrong value for stx_blocks

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-hwe-6.8/+bug/2137491/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to