mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/rc: fix _get_max_lfs_filesize on 32-bit platforms
The 32-bit calculation of the maximum filesize is incorrect. Replace it
with the formula that the kernel has used since commit 0cc3b0ec23ce
("Clarify (and fix) MAX_LFS_FILESIZE macros"). This fixes a regression
in generic/351 on 32-bit kernels.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
e002de2e5b
commit
cfa9327172
@@ -3999,7 +3999,9 @@ _get_max_lfs_filesize()
|
||||
{
|
||||
case "$(getconf LONG_BIT)" in
|
||||
"32")
|
||||
echo $(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
|
||||
local ulong_max=$(getconf ULONG_MAX)
|
||||
local page_size=$(getconf PAGE_SIZE)
|
||||
echo $(( ulong_max * page_size ))
|
||||
;;
|
||||
"64")
|
||||
echo 9223372036854775807
|
||||
|
||||
Reference in New Issue
Block a user