From nobody Sun Feb 8 15:46:47 2026 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED8752206BC for ; Tue, 25 Feb 2025 03:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740454787; cv=none; b=l1rGF4i93ot/l3UCvdClkrssWoa5JaENFlWEQ3GvtDyw1D2JZAMKLOimPmk/X7T2WB8VQBjM3eIvmNOxMXTFGo/TthrZbNG5IDmrB6D2J7aKUtGMFS3RFRuc7KNGbH9MB5KNKxYEQ9NDghBUTgMEfKi8O6kDWdXDoWU9lGWG8GY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740454787; c=relaxed/simple; bh=aF1WRTePyUyRnZHJpGhucp9w76Ljz8qdTGSMRJjqC9Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IPd3C9pD71g9/B6aBU8XRdxzs09cr40V5nE1WbjkR1kJ9gCL6gazoPdwrKusiLWNoL/r3y3oH3FZ7v7qqtjvCc14kZJEYVBtdvWsWUf/UiW52AE8QfdFPAbJ7im4ymFCCHBESerwRk2ZoMTWHHr3LjvaMotOsyPwCRnpVbDI4xE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=cvgcx60o; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="cvgcx60o" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1740454780; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=wfIqepXZVUfIjlPUk4Da5gDeRqNF03KNFcNHAJQ76D4=; b=cvgcx60oMVecghl6p12IkDscpCOmPH6tPl6KPsWU3kBOJAb7edkSA9qwlP1VqZu3wqZmhM89DNxipte0qMY4aK/veXfSLJVDusraqJ+nzn/FgAIQ/viR97WQzDKO/sm5Oae3Hqsf6W92Kayaxb0GtOCoVoapng3eu1hkdSbt6dA= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WQD6RSw_1740454776 cluster:ay36) by smtp.aliyun-inc.com; Tue, 25 Feb 2025 11:39:39 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH] erofs: allow 16-byte volume name again Date: Tue, 25 Feb 2025 11:39:34 +0800 Message-ID: <20250225033934.2542635-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Fixes: a64d9493f587 ("staging: erofs: refuse to mount images with malformed= volume name") [1] https://lore.kernel.org/r/96efe46b-dcce-4490-bba1-a0b00932d1cc@linux.al= ibaba.com Signed-off-by: Gao Xiang Reviewed-by: Chao Yu --- fs/erofs/internal.h | 2 -- fs/erofs/super.c | 8 -------- 2 files changed, 10 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index f955793146f4..b452b6557aa5 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -152,8 +152,6 @@ struct erofs_sb_info { /* used for statfs, f_files - f_favail */ u64 inos; =20 - u8 uuid[16]; /* 128-bit uuid for volume */ - u8 volume_name[16]; /* volume name */ u32 feature_compat; u32 feature_incompat; =20 diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 3dc86d931ef1..19e52ffa34c5 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -317,14 +317,6 @@ static int erofs_read_superblock(struct super_block *s= b) =20 super_set_uuid(sb, (void *)dsb->uuid, sizeof(dsb->uuid)); =20 - ret =3D strscpy(sbi->volume_name, dsb->volume_name, - sizeof(dsb->volume_name)); - if (ret < 0) { /* -E2BIG */ - erofs_err(sb, "bad volume name without NIL terminator"); - ret =3D -EFSCORRUPTED; - goto out; - } - /* parse on-disk compression configurations */ ret =3D z_erofs_parse_cfgs(sb, dsb); if (ret < 0) --=20 2.43.5