android_kernel_motorola_sm6375/fs/ext2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zhang Yi cc16d0bc1c ext2: correct max file size computing
[ Upstream commit 50b3a818991074177a56c87124c7a7bdf5fa4f67 ]

We need to calculate the max file size accurately if the total blocks
that can address by block tree exceed the upper_limit. But this check is
not correct now, it only compute the total data blocks but missing
metadata blocks are needed. So in the case of "data blocks < upper_limit
&& total blocks > upper_limit", we will get wrong result. Fortunately,
this case could not happen in reality, but it's confused and better to
correct the computing.

  bits   data blocks   metadatablocks   upper_limit
  10        16843020            66051    2147483647
  11       134480396           263171    1073741823
  12      1074791436          1050627     536870911 (*)
  13      8594130956          4198403     268435455 (*)
  14     68736258060         16785411     134217727 (*)
  15    549822930956         67125251      67108863 (*)
  16   4398314962956        268468227      33554431 (*)

  [*] Need to calculate in depth.

Fixes: 1c2d14212b ("ext2: Fix underflow in ext2_max_size()")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Zhang Yi <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2022-04-15 14:18:13 +02:00
..
acl.c
acl.h
balloc.c ext2: fix sleeping in atomic bugs on error 2021-10-09 14:39:49 +02:00
dir.c
ext2.h
file.c ext2: don't update mtime on COW faults 2020-09-09 19:12:30 +02:00
ialloc.c ext2: fix missing percpu_counter_inc 2020-08-21 13:05:26 +02:00
inode.c
ioctl.c
Kconfig
Makefile
namei.c
super.c ext2: correct max file size computing 2022-04-15 14:18:13 +02:00
symlink.c
xattr.c
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c