android_kernel_asus_sm8350/fs/erofs
Gao Xiang 96a85becb8 erofs: fix compact 4B support for 16k block size
commit 001b8ccd0650727e54ec16ef72bf1b8eeab7168e upstream.

In compact 4B, two adjacent lclusters are packed together as a unit to
form on-disk indexes for effective random access, as below:

(amortized = 4, vcnt = 2)
       _____________________________________________
      |___@_____ encoded bits __________|_ blkaddr _|
      0        .                                    amortized * vcnt = 8
      .             .
      .                  .              amortized * vcnt - 4 = 4
      .                        .
      .____________________________.
      |_type (2 bits)_|_clusterofs_|

Therefore, encoded bits for each pack are 32 bits (4 bytes). IOWs,
since each lcluster can get 16 bits for its type and clusterofs, the
maximum supported lclustersize for compact 4B format is 16k (14 bits).

Fix this to enable compact 4B format for 16k lclusters (blocks), which
is tested on an arm64 server with 16k page size.

Fixes: 152a333a58 ("staging: erofs: add compacted compression indexes support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230601112341.56960-1-hsiangkao@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:37:35 +02:00
..
compress.h
data.c erofs: avoid using generic_block_bmap 2020-12-30 11:51:23 +01:00
decompressor.c erofs: avoid consecutive detection for Highmem memory 2022-08-25 11:17:36 +02:00
dir.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
erofs_fs.h erofs: add unsupported inode i_format check 2021-05-11 14:04:02 +02:00
inode.c erofs: add unsupported inode i_format check 2021-05-11 14:04:02 +02:00
internal.h erofs: fix potential overflow calculating xattr_isize 2023-05-17 11:35:35 +02:00
Kconfig erofs: kill all erofs specific fault injection 2019-09-05 20:10:08 +02:00
Makefile
namei.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
super.c erofs: fix shift-out-of-bounds of blkszbits 2021-03-07 12:20:42 +01:00
tagptr.h
utils.c erofs: correct the remaining shrink objects 2020-04-17 10:50:16 +02:00
xattr.c erofs: initialized fields can only be observed after bit is set 2021-03-04 10:26:43 +01:00
xattr.h erofs: use erofs_inode naming 2019-09-05 20:10:07 +02:00
zdata.c erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF 2023-07-27 08:37:33 +02:00
zdata.h erofs: fix partially uninitialized misuse in z_erofs_onlinepage_fixup 2020-06-30 15:37:07 -04:00
zmap.c erofs: fix compact 4B support for 16k block size 2023-07-27 08:37:35 +02:00
zpvec.h erofs: fix unsafe pagevec reuse of hooked pclusters 2021-11-21 13:38:51 +01:00