summaryrefslogtreecommitdiff
path: root/fs/erofs/inode.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2021-09-22 17:51:41 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2021-09-23 23:22:04 +0800
commitd705117ddd724a9d4877e338e4587010ab6a1c62 (patch)
tree1b4774a9c081bbc7504d3d3dc94fba5ae1350c1c /fs/erofs/inode.c
parent93368aab0efc87288cac65e99c9ed2e0ffc9e7d0 (diff)
erofs: fix misbehavior of unsupported chunk format check
Unsupported chunk format should be checked with "if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL)" Found when checking with 4k-byte blockmap (although currently mkfs uses inode chunk indexes format by default.) Link: https://lore.kernel.org/r/20210922095141.233938-1-hsiangkao@linux.alibaba.com Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/inode.c')
-rw-r--r--fs/erofs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index 31ac3a73b390..a552399e211d 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -176,7 +176,7 @@ static struct page *erofs_read_inode(struct inode *inode,
}
if (vi->datalayout == EROFS_INODE_CHUNK_BASED) {
- if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_ALL)) {
+ if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL) {
erofs_err(inode->i_sb,
"unsupported chunk format %x of nid %llu",
vi->chunkformat, vi->nid);