mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yingjie Wang <x-professor@outlook.com>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: "dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.de>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 3/3] dm zoned: handle labels that are not NUL-terminated
Date: Thu, 3 Dec 2026 15:42:09 +0900	[thread overview]
Message-ID: <a3495d62-7bee-4e8a-8b7c-dc1e4f46538c@kernel.org> (raw)
In-Reply-To: <20261202163137.843291-1-x-professor@outlook.com>

On 2026/12/03 1:31, Yingjie Wang wrote:
> Hi Damien,
> 
> On 12/2/26 14:53, Damien Le Moal wrote:
>> No, I think the extra byte is still needed to be able to honor a device name up
>> to BDEVNAME_SIZE with a NUL terminating character. That needs to stay.
> 
> OK, but then I'm not sure the check is still wanted.  With the extra
> byte, a label that uses all 32 bytes is NUL-terminated in zmd->label,
> so it can be supported.  If labels without a NUL in the 32 bytes on
> disk are rejected, a label has at most 31 characters, and the extra
> byte is never used.

Yeah, good point. With the extra byte added, the last byte is always NUL and so
the check can go away. That is better than the alternative as we can honor the
max name size of BDEVNAME_SIZE, that is, 32 characters.

> 
> So which do you prefer?
> 
> 1) Accept such labels: keep the extra byte, and print at most 32
>    characters of the label read from disk, as in v1.  Volumes created
>    by dmzadm 2.0.0 to 2.1.3 with long device names can still be loaded.
> 
> 2) Reject them: add the check.  These volumes then have to be
>    relabeled with dmzadm 2.2.0 or later.  The extra byte doesn't hurt,
>    but it isn't needed.
> 
> I'm fine with either, and will do v2 accordingly.
> 
> 1/3 and 2/3 don't depend on this patch, in case they can go in first.
> 
> Thanks,
> Yingjie


-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2026-12-03  6:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 10:56 [PATCH 0/3] dm zoned: fix the validation of the superblocks Yingjie Wang
2026-12-01 10:56 ` [PATCH 1/3] dm zoned: do not update metadata state from an invalid superblock Yingjie Wang
2026-12-02  6:41   ` Damien Le Moal
2026-12-01 10:56 ` [PATCH 2/3] dm zoned: validate the metadata layout in the superblock Yingjie Wang
2026-12-02  6:43   ` Damien Le Moal
2026-12-01 10:56 ` [PATCH 3/3] dm zoned: handle labels that are not NUL-terminated Yingjie Wang
2026-12-01 11:06   ` Damien Le Moal
2026-12-01 12:15     ` Yingjie Wang
2026-12-02  5:53       ` Damien Le Moal
2026-12-02 16:31         ` Yingjie Wang
2026-12-03  6:42           ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3495d62-7bee-4e8a-8b7c-dc1e4f46538c@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=x-professor@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®