Re: [PATCH 3/3] dm zoned: handle labels that are not NUL-terminated

From: Yingjie Wang

Date: Wed Dec 02 2026 - 11:31:52 EST


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.

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