Skip to content

Commit 5794502

Browse files
committed
erofs: allow 16-byte volume name again
Actually, volume name doesn't need to include the NIL terminator if the string length matches the on-disk field size as mentioned in [1]. I tend to relax it together with the upcoming 48-bit block addressing (or stable kernels which backport this fix) so that we could have a chance to record a 16-byte volume name like ext4. Since in-memory `volume_name` has no user, just get rid of the unneeded check for now. `sbi->uuid` is useless and avoid it too. [1] https://lore.kernel.org/r/96efe46b-dcce-4490-bba1-a0b00932d1cc@linux.alibaba.com Fixes: a64d949 ("staging: erofs: refuse to mount images with malformed volume name") Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20250225033934.2542635-1-hsiangkao@linux.alibaba.com
1 parent 706e50e commit 5794502

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

fs/erofs/internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ struct erofs_sb_info {
152152
/* used for statfs, f_files - f_favail */
153153
u64 inos;
154154

155-
u8 uuid[16]; /* 128-bit uuid for volume */
156-
u8 volume_name[16]; /* volume name */
157155
u32 feature_compat;
158156
u32 feature_incompat;
159157

fs/erofs/super.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,6 @@ static int erofs_read_superblock(struct super_block *sb)
317317

318318
super_set_uuid(sb, (void *)dsb->uuid, sizeof(dsb->uuid));
319319

320-
ret = strscpy(sbi->volume_name, dsb->volume_name,
321-
sizeof(dsb->volume_name));
322-
if (ret < 0) { /* -E2BIG */
323-
erofs_err(sb, "bad volume name without NIL terminator");
324-
ret = -EFSCORRUPTED;
325-
goto out;
326-
}
327-
328320
/* parse on-disk compression configurations */
329321
ret = z_erofs_parse_cfgs(sb, dsb);
330322
if (ret < 0)

0 commit comments

Comments
 (0)