file: bump sz_size to 64 bits
authorPaul Donald <[email protected]>
Tue, 2 Dec 2025 23:13:14 +0000 (00:13 +0100)
committerRobert Marko <[email protected]>
Wed, 3 Dec 2025 21:48:31 +0000 (22:48 +0100)
commita284e7751fa76a0a9a5db3893e8abf335da89aaf
tree488092fa3612dc6fbb390172bcfbde5386b86ed1
parent483263c7b0cd3922b93be2cf9dad5eeccbb9fedb
file: bump sz_size to 64 bits

Some systems reveal /proc/kcore which for 64 bit systems has a size of

140,737,471,586,304 bytes.

This is a virtual mapping of the maximum possible RAM in a system. But if a 32
bit value tries to hold this, it is displayed as the erroneous value

-16,769,024 bytes

Bump the size to 64 bits to hold the correct value (and correct values for large
files).

Before this patch:

ubus call file list '{"path":"/proc"}'
...
{
"name": "kcore",
"type": "file",
"size": -16769024,
"mode": 33024,
"atime": 1764716086,
"mtime": 1764716086,
"ctime": 1764716086,
"inode": -268435271,
"uid": 0,
"gid": 0,
},
...

After this patch:

ubus call file list '{"path":"/proc"}'
...
{
"name": "kcore",
"type": "file",
"size": 140737471586304,
"mode": 33024,
"atime": 1764716086,
"mtime": 1764716086,
"ctime": 1764716086,
"inode": -268435271,
"uid": 0,
"gid": 0,
},
...

Tested on: OpenWrt SNAPSHOT r32139-1f879b8839 / 6.12.59
Signed-off-by: Paul Donald <[email protected]>
Link: https://github.com/openwrt/rpcd/pull/22
Signed-off-by: Robert Marko <[email protected]>
file.c