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=1796191133; b=G3L/grlXTAvm+ITojBvNjY7efymsag9Oj3Be3PeiJBGSUv2fnEOpeFO1G2DvUY0VKaQB Zeom45J2pjngmiVfDm3aW26iCxvgDg3AGW693n7bViT4RQGwcV/p5tuWVoX2kfCFQ7IZj PA1hK3QJg5jd3idqqYNViNhyu2EKwE9YnSh4e9D6rSQ5g3BRHXwTZ7315IHicfKBzBy6q kYsPgc6X861BhmyfDUm7gPuX3rR6cJYSOCL6PDP5ppHJWlSA6mO/YR8EUQvYUyo3x7a0c f1qYUQvQOhfoUTwxOUsGg4Ca6tb4Ac0Nvi9uM0u0FKOOPYmih9u0pvyVw8ExvHaTG9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796191133; 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=+YDBk8TJLTey23uXyUJn8CO4PysmCx4v4IiG+SzY28k=; b=0upj/NH7f/bRBaDPTyrq9075+fzFZBoj3n+areErS805WcFdENnSjXlcK8R5nCvFlF4i Vym3t7Lq2I2XMHKrt/3JeTM5CrVYpkg79t0H+WMlWzbygX8NCcWcyxQTOLZX+nxI2KM4d 6m4RDLpB3C/LvL4oVqPfZvqjwmCCvs8Yb7sZTn1DYGLUHRCMuEuOH5JhiLZQajGddcr2y lwUBsw7dNo8PY9XvWrav/0rN7VOORbryLfXMI1NPFaOdXsc4mr0HaQCqHrZC+Q+2xRnYz 92HXGzoEa6+Kaxte6X+gjlW5Lr5OuwY3Zo/+22pBanfYkyi60j9OFKiGRpSUl7+4ZrA== 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=XVxjUR0y; 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 F112D606A31A; Wed, 2 Dec 2026 05:58:52 +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=XVxjUR0y Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15F4F1F000C1; Wed, 2 Dec 2026 05:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796191132; bh=+YDBk8TJLTey23uXyUJn8CO4PysmCx4v4IiG+SzY28k=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=XVxjUR0yNW0D9Pf/UBsAW2JtdWt4mp0VCA7qNh4gu/YoyYBGIRognc9PT6A3TdMBM eQmvcKhYe8DWNRiYxTPgoiUN6AfqfjkXtaG10dx/H1CFpi7tyYx332sQjHfHrbZnMZ 6HZ9mGGQVZTWAqeI86ik4ArVvhn6N1JOneqFYQu/9NSOhEoJuNTpTkl+dV2TOdS3MJ 3W9c6VuuPzuZOBo0sUHjkDCHD2m0D8+fn53+q3XL0qBoUt6/3MczoGoRX5LcJbWVkc 60BxDp96umHoa6jpqIVGXHhhpXNKvFVOOjG+kHfk81qG8WH21TbOrtdgJcuZknXBE5 OBDCXHScnTGIQ== Message-ID: <0f6bba24-76c3-4811-b2e3-9f44d82166d8@kernel.org> Date: Wed, 2 Dec 2026 14:58:49 +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 2/3] dm zoned: check the metadata zones before recovering a metadata set To: Yingjie Wang , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski Cc: "dm-devel@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Hannes Reinecke , Dan Carpenter , "stable@vger.kernel.org" References: <20261130161425.3535695-1-x-professor@outlook.com> <20261130161707.3536733-1-x-professor@outlook.com> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20261130161707.3536733-1-x-professor@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/1/26 01:17, Yingjie Wang wrote: > dmz_ctr_metadata() verifies that the zones of both metadata sets exist > and are random or cache zones, but only after dmz_load_sb() has > returned. By then, dmz_recover_mblocks() may already have written to > these zones. > > The position of the secondary superblock is not checked against the > number of metadata zones it describes either. If > dmz_lookup_secondary_sb() finds it in the first zone searched and it > describes two metadata zones per set, for example, recovering the > primary set overwrites the secondary superblock that it is recovering > from, and the table is loaded. > > Move the zone checks to dmz_check_sb(), and also check there that the > zones are on the device that holds the metadata and that the secondary > superblock is where it is expected to be. Volumes formatted with dmzadm > are not affected, because it places the secondary set right after the > primary one and requires both to fit on that device. > > This is needed before fixing dmz_lookup_secondary_sb(). Otherwise, more > superblocks would be found and used for recovery without these checks. > > Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target") > Cc: stable@vger.kernel.org > Signed-off-by: Yingjie Wang Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research