From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796280134; b=w31l7Y93Mt6DWNvon58Rz5mdVCABEiO5qmkAzM3y6Wah80y3jfikDbtSJLz4iV2/H1Je uBDSLkslv2t43eqbi0qs3GjqDZy7Y6yypnPvhfKPr4bqy2I3PgL12AuYWA7A5kqLKcvnb qCc+FXsGmcgWNpONf9YP/Ua1nJAe7MiK8J/LfRQIEoTTEP/I2KTXX3rxhmMdRaE0sXrK0 RpgogeFE6+toSlnXR0qiQBCeu1mtq6awqrXGXD0zNreqYJygz+hUUOs6Sdtx5CIN0XVMy dvbbpjp5pavkAlyz1JDBWJwRWkEoQZhSD5p4MnqKLoLDGnned1/Vh6JnmDj/SpfGwYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796280134; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=7oEZtfxbnd69cFdmn4aHfpxqdJttsPACfch5UNYvdbQ=; b=3MyeoOd4bVcaqWErHdjAlkUf3wqBu8SyotSOc7izIKsTguj6cFee4kWzdOeSRYtuqzi2 9nKTrJfn5Z/WaLlhmi0rj9Jf7PjW6uZ7WU+LVYl23nLuqP8qEcty2m/6lCgxwS8Lv8CMt RV23JOisbOuGKY61NIcU2xOr82y3/3DCEA0gypGH3UUT7KS22biYduT+QFkV2c72MzJp3 C7gIm+TZa0ZzRCDqAxhzLTlgNj/xc/uer+pUsrbetD3V3ebviSNjhB1lg+Wiuzhw841cj uIbW61UFOdQlAZpl9dzkPzfTO5Yq0eqJaDSvSSuF1QtyhAl1QdVoPs6pA/6co4IsPeQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Gqf5yJ/x"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02C0F606A322; Thu, 3 Dec 2026 06:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gqf5yJ/x Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AC1E1F00893; Thu, 3 Dec 2026 06:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796280133; bh=7oEZtfxbnd69cFdmn4aHfpxqdJttsPACfch5UNYvdbQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Gqf5yJ/xSAMeOJre6eRigPxA6R9uNBs1tWM/LnRfxrh1OUibyeyKOnqYE3Lg7YcQk MhRu9XxpMYfv4K4aJ2eechFJhbD0RxIiVG/ZYBjPpqpOsXONA0j2ZrCH5g/uNcnkkt sNWOY9dCdgx1S86GBXpRxEgHCE+bod4qettV7MjMTyKwmi3tsFxXEYjKxFumvbVA2k 1ntt6RMK2yW8AFhgUMH94CPO6IMqvfRQnnbk7ZplSnYmaaZu5DT45ESBMfrwsUEban 82avdwOTtni8otYmV9YEBLLn3lYzLqoPujlPcR8sM0zCDh1YOjuhnbV4NJdK5jNsGB SLN4iZJAOB8Sw== Message-ID: Date: Thu, 3 Dec 2026 15:42:09 +0900 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] dm zoned: handle labels that are not NUL-terminated To: Yingjie Wang , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski Cc: "dm-devel@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Hannes Reinecke , "stable@vger.kernel.org" References: <20261201105558.117053-1-x-professor@outlook.com> <20261201105625.117301-1-x-professor@outlook.com> <3f39a119-bbb2-40ed-8107-a20f8ea87fd9@kernel.org> <20261201121502.229596-1-x-professor@outlook.com> <20261202163137.843291-1-x-professor@outlook.com> From: Damien Le Moal Content-Language: en-US Organization: Western Digital Research In-Reply-To: <20261202163137.843291-1-x-professor@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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