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=1796384415; b=JbTWSpV4Ebt/DCJjHrwG95EmUSKlnp+40t/5CkZFGtzJ+APMGSNklSw1dibZRFGTMgOZ pvJOf0H2/spQklTWijG/981xggZC4YWdTKXaeiG0tYK4dbHiRHIJts0L+gz+IMwoA3W/h QbfKhdR7/eQ0kLqBSQ+9l/kgAV45zto2o3E+cpKke5C6myQfcNTI0/BJbBMpcMdC36BjT Xv/CRq5lzQTpuJfW3VYGJb/8B/z92D4VqEd3nAa4dj3+wEU2Q19xiEDNpq+DtOmQjZUt5 pl0lH0741Wjf9sCOVT/OesHJzM8zUmsv5nGEfNWI95HBLx1chHaaKc5S3DgMLs+cD3Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384415; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=OPt2Ep6O+el3lLTNXf1Db3UWshIbZ2WHEClNeTE7nwo=; b=vLkFKtCLsO8ltSnuPo8/+tAWdmJwhvEjWJQXQRSPgrWqOOqUFPFkCHODg8wtz8Yei8J3 ZE2iaYZBrzB+UQGDNd6jy/B9esyE6OgQuUmYFRmgSYtwnLkJ/PndiXdi0oYlSioKReWRZ PdiuEw6UBw2iqL5SO02nB0EfwsWcFM91HiS+xH82nOrRUrzdRxxlQeE1aez3OETabScLG Vi+XTLEW1h+DhU0RpxbnVGkBve0OC3av5v8WvzhEuIDW7MUOtmKheRja+j2qTQQRRsn30 KR9NZQGC3o3NDhQopAZAZvr3xcN5VQTX3K2cOSOZ+pGpTNjzq+A2cWTf3MRO7dZhu9A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TlZVNRH4; 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 ABB13606A32C; Fri, 4 Dec 2026 11:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TlZVNRH4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A0DC1F000C2; Fri, 4 Dec 2026 11:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384415; bh=OPt2Ep6O+el3lLTNXf1Db3UWshIbZ2WHEClNeTE7nwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TlZVNRH43LIZSFvPNvc0rZgDeeehKev+2VllBGDXsf7ry11rL4HrzI7jEbfL3Mcbc fktc25B2XQJkH5lgwOlh2a13kYdsqr5CquX3rCRTVuN/zR1sJl1oI1eBCLz8VJiZ3L tiG/WiB0nr1L1jVdhS15Jdsc2msNqjyVrJYrMf7Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Damien Le Moal , Niklas Cassel , Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0139/1167] null_blk: fix opening closed zones at the active zone limit Date: Fri, 4 Dec 2026 18:52:46 +0900 Message-ID: <20261204100705.707675922@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel [ Upstream commit 6f2b59737bf9cf3623719857ac149f0d431db109 ] When the open zone limit is reached, null_check_open() closes an implicitly open zone only if the active zone limit is not reached. Closing an implicitly open zone does not change the number of active zones, so this check is wrong. For an empty zone, the active zone limit was already checked by null_check_zone_resources(). For a closed zone, the check makes writing to, opening or finishing the zone fail with BLK_STS_ZONE_OPEN_RESOURCE at the active zone limit, whereas ZBC-3 (4.5.3.2.7.2) and NVMe ZNS (2.1.1.4.1) require closing an implicitly open zone instead. Remove the check, and update the comment above null_check_zone_resources() accordingly. Fixes: dc4d137ee3b7 ("null_blk: add support for max open/active zone limit for zoned devices") Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20261022092158.2248831-6-cassel@kernel.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/null_blk/zoned.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c index 6ed46db23cb2d..50e04fffb92b9 100644 --- a/drivers/block/null_blk/zoned.c +++ b/drivers/block/null_blk/zoned.c @@ -335,10 +335,8 @@ static blk_status_t null_check_open(struct nullb_device *dev) return BLK_STS_OK; if (dev->nr_zones_imp_open) { - if (null_check_active(dev) == BLK_STS_OK) { - null_close_imp_open_zone(dev); - return BLK_STS_OK; - } + null_close_imp_open_zone(dev); + return BLK_STS_OK; } return BLK_STS_ZONE_OPEN_RESOURCE; @@ -354,8 +352,11 @@ static blk_status_t null_check_open(struct nullb_device *dev) * * ZBC states that an implicit open zone shall be closed only if there is not * room within the open limit. However, with the addition of an active limit, - * it is not certain that closing an implicit open zone will allow a new zone - * to be opened, since we might already be at the active limit capacity. + * it is not certain that closing an implicit open zone will allow an empty + * zone to be opened, since we might already be at the active limit capacity. + * Therefore, the active limit is checked first for an empty zone. A closed + * zone already holds an active zone resource, so only the open limit has to + * be checked for a closed zone. */ static blk_status_t null_check_zone_resources(struct nullb_device *dev, struct nullb_zone *zone) -- 2.53.0