]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
erofs: fix large fragment handling
authorGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 11 Jul 2025 19:58:26 +0000 (03:58 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 11 Jul 2025 20:02:44 +0000 (04:02 +0800)
commitb44686c8391b427fb1c85a31c35077e6947c6d90
treebc199d06ce072d96c10a0201089288417d99ace0
parentd31fbdc4c7252846ea80235db8c1a8c932da9d39
erofs: fix large fragment handling

Fragments aren't limited by Z_EROFS_PCLUSTER_MAX_DSIZE. However, if
a fragment's logical length is larger than Z_EROFS_PCLUSTER_MAX_DSIZE
but the fragment is not the whole inode, it currently returns
-EOPNOTSUPP because m_flags has the wrong EROFS_MAP_ENCODED flag set.
It is not intended by design but should be rare, as it can only be
reproduced by mkfs with `-Eall-fragments` in a specific case.

Let's normalize fragment m_flags using the new EROFS_MAP_FRAGMENT.

Reported-by: Axel Fontaine <axel@axelfontaine.com>
Closes: https://github.com/erofs/erofs-utils/issues/23
Fixes: 7c3ca1838a78 ("erofs: restrict pcluster size limitations")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250711195826.3601157-1-hsiangkao@linux.alibaba.com
fs/erofs/internal.h
fs/erofs/zdata.c
fs/erofs/zmap.c