erofs: fix misbehavior of unsupported chunk format check
PATCH 1/1 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.)
--- fs/erofs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/inode.c +1 -1
@@ -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);
Signature · 1 line
1.8.3.1
Quoted 6 lines · Gao Xiang
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.)
Good catch.
thanks,
liubo
Quoted 23 lines
Fixes c5aa903a59db ("erofs: support reading chunk-based uncompressed files")Cc Liu Bo <[email protected]>Cc Chao Yu <[email protected]>Signed-off-by Gao Xiang <[email protected]>--- fs/erofs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/erofs/inode.c +1
-1@@ -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);Signature · 1 line
1.8.3.1
Quoted 4 lines · Gao Xiang
Unsupported chunk format should be checked with
"if (vi->chunkformat& ~EROFS_CHUNK_FORMAT_ALL)"Found when checking with 4k-byte blockmap (although currently mkfs
That means for 4k-byte blockmap, chunkformat should be zero, right?
Quoted 6 lines
uses inode chunk indexes format by default.)
Fixes c5aa903a59db ("erofs: support reading chunk-based uncompressed files")Cc Liu Bo <[email protected]>Cc Chao Yu <[email protected]>Signed-off-by Gao Xiang <[email protected]>
Thanks,
Gao Xiang
maintainerQuoted 7 lines · Chao Yu
Quoted 4 lines · Gao Xiang
Unsupported chunk format should be checked with
"if (vi->chunkformat& ~EROFS_CHUNK_FORMAT_ALL)"Found when checking with 4k-byte blockmap (although currently mkfs
That means for 4k-byte blockmap, chunkformat should be zero, right?
Yeah, correct. It's a regression of 4kb chunk blockmap..
Quoted 9 lines
Quoted 7 lines
uses inode chunk indexes format by default.)
Fixes c5aa903a59db ("erofs: support reading chunk-based uncompressed files")Cc Liu Bo <[email protected]>Cc Chao Yu <[email protected]>Signed-off-by Gao Xiang <[email protected]>Reviewed-by Chao Yu <[email protected]>
Thanks!
Thanks,
Gao Xiang
Quoted 2 lines
Thanks,