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=1796284822; b=j5aNQya3rkITQt+8ik3TBZokiIBj27hCISOWU4gDglmbj5v6FNppGMuFtK2BOupvK4+U 8ZWTN98KpZ0RpmBl9X+d9Ic1GJwI7k3STNQ0ZYQUaPA7eSgqrWuX3KyGzuKyoYcJuVx2G SgI/cyeSfSeB8I+1ATtKuq71q2Gq7cq6vE7cOJ9gefqSEgCIVQQ/b+wlD9l9Pt89EVWNo Wl4I7RWD0A7m88MzSPsIl5RWVdtzSUN3h+JRErhPfXue1JE4z1D/Yo0OVaA84nhMYsqwt V/UktuSMGPhXB7sSXPbARz6T65ufZ6lDPiw7EYp5KgCxTXv5zZvjk8PcV6mPTjSuHxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284822; 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=6DkKIDfPxqNo/gBqNQoUo2Hr89hPOd2lcTizIc6s8SM=; b=muho2p2XfnFkIOnp/xYx0pf2a0nbjK1frwpCbNZOHJbD9pebN2Hmjk4vSxJAH74sZIwJ 5ajnIdzchZVLPfj3TqaZkWbYWw2jSTOoTFqgGsUHUTn6lGMBJzkjvuGEr5BJxw1QSojUT rpW29SxZauSxwPWOgXCYwEcTBnbgrODCl0KpWxQhu9cmjvD3cTLlqOyV5d4D0DBpXqhY9 qA1yr+p+dO20ZD7wyywHVKOeOKU5zgVn3Ox/8tWtijM+bWhiv/9F8SLD/rCmB3cpa4cSP VIm+OE7jinxKq4i2TcAngxMqMubblTW96GteRZ3MUU36/Ofqk4ppGMoGOMTERirYhTw== 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=Q0sdyhIl; 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 1E7C4606A32C for ; Thu, 3 Dec 2026 08:00:22 +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=Q0sdyhIl Received: by smtp.kernel.org (Postfix) with ESMTPSA id 382151F00893; Thu, 3 Dec 2026 08:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796284822; bh=6DkKIDfPxqNo/gBqNQoUo2Hr89hPOd2lcTizIc6s8SM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Q0sdyhIlsIobzQf7f6K3qLUFah5Y3tDNY2PeeoPevSyZ9eBCbhvconZGK8VW3PwDD jVYLRlX8vUauyQ7Nhj+jdz/IwyT1HypsnCwTxlD8klVd2H3BXyEEtTwTnKX1J+bZ0T 3birjP8WULTnw5lAoupa5Kqy41PKspB5I8mjHMAhXhfvXCFMKowz/R+F/tQNLJyzAc LYl1+haUcbgq62Yzr9J9UpdsTuT/csVR5pHICol82EWGXei0tar3XMeSGDakTKYXaM cFzci34koiIFlZoWr4k4ENxdfmjonjnQB9cFPui9j8KApEXgDIAEixTNXS7NNB61XK 8ImFb4OX9Sr6w== Message-ID: <2cac1074-5f09-4b77-8b15-fae01f5d3004@kernel.org> Date: Thu, 3 Dec 2026 17:00:19 +0900 X-Mailing-List: linux-block@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 30/52] blk-zoned: Annotate struct blk_zone_wplug members with __guarded_by() To: Christoph Hellwig Cc: Bart Van Assche , Jens Axboe , linux-block@vger.kernel.org, Nathan Chancellor References: <3a07bc8f-5eae-4253-b2a4-7edece984b8d@kernel.org> From: Damien Le Moal Content-Language: en-US Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2026/12/03 16:56, Christoph Hellwig wrote: > On Thu, Dec 03, 2026 at 04:50:26PM +0900, Damien Le Moal wrote: >> Calling disk_free_zone_wplug() with the zwplug spinlock still held would be a >> really big problem since that potentially could result in a use after free. So >> what path are you talking about here? >> >> This entire annotation thing makes the code really ugly... > > Well, part of it is having to explain the locking rules, and if they > are complicated that usually shows real problems. > > The other is the whole scope_guarnd and unsafe_context junk, which > really needs to be replaced with something sane before we can use > these annotations without turning the code into cat barf. > > Mostly due to the latter I've largely given up on trying to use this > otherwise extremely useful feature. OK. But my point about the comment saying that disk_free_zone_wplug() may be called with or without the spinlock held stands though: that is not correct and the annotation should reflect that the lock must *not* be held instead of saying "maybe". So we need a "__must_not_hold()" or similar. -- Damien Le Moal Western Digital Research