linux/fs/erofs
Gao Xiang 0852b6ca94 erofs: fix 1 lcluster-sized pcluster for big pcluster
If the 1st NONHEAD lcluster of a pcluster isn't CBLKCNT lcluster type
rather than a HEAD or PLAIN type instead, which means its pclustersize
_must_ be 1 lcluster (since its uncompressed size < 2 lclusters),
as illustrated below:

       HEAD     HEAD / PLAIN    lcluster type
   ____________ ____________
  |_:__________|_________:__|   file data (uncompressed)
   .                .
  .____________.
  |____________|                pcluster data (compressed)

Such on-disk case was explained before [1] but missed to be handled
properly in the runtime implementation.

It can be observed if manually generating 1 lcluster-sized pcluster
with 2 lclusters (thus CBLKCNT doesn't exist.) Let's fix it now.

[1] https://lore.kernel.org/r/20210407043927.10623-1-xiang@kernel.org

Link: https://lore.kernel.org/r/20210510064715.29123-1-xiang@kernel.org
Fixes: cec6e93bea ("erofs: support parsing big pcluster compress indexes")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
2021-05-13 15:58:46 +08:00
..
compress.h erofs: force inplace I/O under low memory scenario 2020-12-09 20:42:02 +08:00
data.c erofs: don't use erofs_map_blocks() any more 2021-03-29 10:19:53 +08:00
decompressor.c erofs: support decompress big pcluster for lz4 backend 2021-04-10 03:20:19 +08:00
dir.c erofs: Replace HTTP links with HTTPS ones 2020-08-03 21:04:29 +08:00
erofs_fs.h erofs: enable big pcluster feature 2021-04-10 03:20:19 +08:00
inode.c erofs: add unsupported inode i_format check 2021-03-29 10:20:45 +08:00
internal.h erofs: support decompress big pcluster for lz4 backend 2021-04-10 03:20:19 +08:00
Kconfig erofs: introduce physical cluster slab pools 2021-04-10 03:20:16 +08:00
Makefile erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
namei.c erofs: use %pd instead of messing with ->d_name 2021-01-06 19:39:37 -05:00
pcpubuf.c erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
super.c erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
tagptr.h erofs: move erofs out of staging 2019-08-24 14:20:10 +02:00
utils.c erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
xattr.c erofs: initialized fields can only be observed after bit is set 2021-02-11 11:55:28 +08:00
xattr.h erofs: Replace HTTP links with HTTPS ones 2020-08-03 21:04:29 +08:00
zdata.c erofs: fix up inplace I/O pointer for big pcluster 2021-04-10 03:20:16 +08:00
zdata.h erofs: introduce physical cluster slab pools 2021-04-10 03:20:16 +08:00
zmap.c erofs: fix 1 lcluster-sized pcluster for big pcluster 2021-05-13 15:58:46 +08:00
zpvec.h erofs: Replace HTTP links with HTTPS ones 2020-08-03 21:04:29 +08:00