erofs: fix ztailpacking on > 4GiB filesystems
authorGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 22 Feb 2022 03:31:18 +0000 (11:31 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 2 Mar 2022 13:58:45 +0000 (21:58 +0800)
z_idataoff here is an absolute physical offset, so it should use
erofs_off_t (64 bits at least). Otherwise, it'll get trimmed and
cause the decompresion failure.

Link: https://lore.kernel.org/r/20220222033118.20540-1-hsiangkao@linux.alibaba.com
Fixes: ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support")
Reviewed-by: Yue Hu <huyue2@yulong.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/internal.h

index b8272fb..5aa2cf2 100644 (file)
@@ -325,7 +325,7 @@ struct erofs_inode {
                        unsigned char  z_algorithmtype[2];
                        unsigned char  z_logical_clusterbits;
                        unsigned long  z_tailextent_headlcn;
-                       unsigned int   z_idataoff;
+                       erofs_off_t    z_idataoff;
                        unsigned short z_idata_size;
                };
 #endif /* CONFIG_EROFS_FS_ZIP */