Skip to contentSkip to conversation

erofs: fix ztailpacking on > 4GiB filesystems

PATCH In review Gao Xiang 3 participants 4 messages Feb 22, 2022 – Mar 2, 2022 EROFS file system

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs: fix ztailpacking on > 4GiB filesystems

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.

Fixes ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support")
---
 fs/erofs/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/internal.h +1 -1
index b8272fb95fd6..5aa2cf2c2f80 100644
@@ -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 */
Signature · 1 line
2.24.4
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Tue, 22 Feb 2022 11:31:18 +0800 Gao Xiang <[email protected]>…

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.

Fixes ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support")
---
 fs/erofs/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/internal.h +0 -0
index b8272fb95fd6..5aa2cf2c2f80 100644

fs/erofs/internal.h struct erofs_inode { · line 331

Quoted 8 lines
fs/erofs/internal.h +1 -1
@@ -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 */
author
#3 lore raw
Quoted 9 lines · Chao Yu
Quoted 6 lines · Gao Xiang

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.

Fixes ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support")

Thanks Chao. Yeah, I will submit it this week..

Thanks,
Gao Xiang

Quoted 2 lines

Thanks,