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=1796193705; b=M2k6z3CEp35J2wqsgJZc0DJ4Nfk4F4tBi87wp4uAF7/Lm+Ib2szjXVwWLU8tfh92Fdgi j/7ldOMGrKT1vuOk0lgYuDyUiP/V9KkT717xs9QzCqbgqyj25nFHAK2gRuM2VM8n9ILQB u7SLgVs8Tjo6/h5E7M1R6/3/+GUPW3iKDf1+0MtXIt5Wbyi3WMZs9Y57V5HWqfr7+cKQp I+BFSxztaQ/rQk7o6vXeyXQlTrrFGA3Oafo101dW0LD3vnfofIi42ZM+KdPVL8lTi4Et6 UNG6c8jcZBJAp73Bt3ACbGNjk9ans1u2wMdSAGCnv+itSqylNcFrpdq1NMFPt8JfFYA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796193705; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=PNhN7D8RZnlVjdrfgehMH9rsIXqCKhcSQFLO6l3N1UI=; b=u2V5btWIIVVmcLxT03jlIgUyNESNHAQ/ayhauPXfvv5UspbegC6V1zLiwK8nyQ395/ra ou+8gZGmVn8kPaDMTSfrUFxA4keI6gvb2xwOJMyIa8z/BDvIe/6BLrIwB4hCX7W9KJbMX aptMU+wTroqPHm2t5ZxyHp1ydMRqd3CAOGDs7/Br1EMZQ2He1V3U3cwr8+BABtTRNpFKY 2KDcysL6gKlA+Z3FZgGh/gm+1Awtgunx+IWlFZ+uLMbpG308eEHV/A7jxHnxgnC0bYkdI oEhSiw1p21Ktm9nGqDk4GKtpu32CHFg6y0XXD87gsYzu+oCu7Vg6HuCywGv52w0UsAg== 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=RNA8VR7O; 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 F1DDE606A31A; Wed, 2 Dec 2026 06:41:44 +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=RNA8VR7O Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31FB61F00893; Wed, 2 Dec 2026 06:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796193704; bh=PNhN7D8RZnlVjdrfgehMH9rsIXqCKhcSQFLO6l3N1UI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=RNA8VR7O1bT6MA8IaacoYNwpxdTDWSu8MGXTnS21F7rueMnNu8QaqJw7zr1Lv2xIX XlYxAtYFL59mbq0eL17UIYEuXCVc4RXbI52+kKResecMCO14tilup81pKQGMKQcClm hrBuwvkDMjPedXlvtqgihSuFX3/2ef2FpAcx6o+0jjmOMiVrnXUhHkK3hi707APO0r Apn7KOQ2qCRU0hlBjtdTvs6LiyBZPAwdEbvXghipqgZRuxDPlY3U7MxSWc7n3OPTOu W5nMpbB3Ip5D7lzp7naI13tCiBVwQRNtLafOYzXAaJA4q2wuZYtqHysQQsft6wEUhH +ZUM48GFjML+A== Message-ID: <52a3f329-35a7-4c90-8c15-a2694128fb4f@kernel.org> Date: Wed, 2 Dec 2026 15:41:40 +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 1/3] dm zoned: do not update metadata state from an invalid superblock 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> <20261201105609.117158-1-x-professor@outlook.com> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20261201105609.117158-1-x-professor@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/1/26 19:56, Yingjie Wang wrote: > dmz_check_sb() stores the version, UUIDs and label of a superblock > before it has finished validating it. If the superblock is then > rejected, zmd and the device are left with the values it contained. > > If the secondary superblock is invalid, it is recovered from the primary > one using these values, and the next metadata flush writes them to the > primary superblock, too. For example: > > - If the secondary superblock has a bad checksum and a version of 1, > both superblocks become version 1, and the tertiary superblocks are > not checked anymore. > > - If it has no device UUID, the device UUID is cleared in both > superblocks. Both are invalid then, and the table cannot be loaded > anymore. > > Conversely, if the primary superblock is rejected after its UUID and > label were stored, a valid secondary superblock is rejected, too, if > these are different, and the volume is not recovered. > > Use local variables during validation and only update zmd and the > device once the superblock is known to be valid. > > Fixes: bd5c40313a14 ("dm zoned: metadata version 2") > Cc: stable@vger.kernel.org > Signed-off-by: Yingjie Wang Looks good. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research