From patchwork Thu Feb 22 13:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 13567314 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F32A945975 for ; Thu, 22 Feb 2024 13:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607847; cv=none; b=J+AgoIwLF2XZlr4SzpQnCGzrqWxqHhyxaxKsCYzSEby5an3wC1Puku8OHXMqjpojK+VuLcB5x2Ba3nqiBeGKBfN5wf0EyVkxTBIDliL8rKATUwBOwfCDnjPoTyIm4rkicIV31938TdR+pck4SBGEjhJ8KE4Gpo0vlktcdjJqT9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607847; c=relaxed/simple; bh=uWnndMichTYq8W6B4vN6SIKZ/TA0mBcuRU76O/+uMkQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ewc31ho67ySS5MH8xa83MT5Rd+htPoph3oCai7zBVDqrx6XfsT7ytubZQpxI9m+7o0QcenWzcsphT0tcjWxw9eL7U2MB1DDTkrdQVTMa1UWtI9M0ANhOC5qH/+CxPW65LsJaBRtRB3t8JuCvUVds4B9AseM8mKtrx3h888MnaXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qb49yNKM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qb49yNKM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18728C43390; Thu, 22 Feb 2024 13:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708607846; bh=uWnndMichTYq8W6B4vN6SIKZ/TA0mBcuRU76O/+uMkQ=; h=From:To:Cc:Subject:Date:From; b=qb49yNKMWqKJ7s+Vj+IwF63S09hVjQYm0f7e/mpihFY393eBrkYf8ooam1aq1Wa/q 1fX693B3KsMkGmYf2Qil42QOx0r07p4/zmaPrqb4Y5345vSQp4l4TgLgphQXJG2OjR JvrJqNa1BrEPVsv5k8DLnhy6yxVTPT7vi7PMTY5mi8vhm7G42X/Qna6btcnWHXHQMH BK69kpnKr4vpGUObz8Oo8gr2tCEA2NWQgjLfXK0yF3xP0shnOkx//SZpX+lavL6sEV Qr7N033Ef2Sq1mknVHuwvrVe1ToV0NZtDtqbayYB8YvyeP7VeqobquMAa1aXSuAPd0 0QyerMjoef81g== From: Damien Le Moal To: Jens Axboe , linux-block@vger.kernel.org Cc: Christoph Hellwig Subject: [PATCH 1/2] block: Clear zone limits for a non-zoned stacked queue Date: Thu, 22 Feb 2024 22:17:23 +0900 Message-ID: <20240222131724.1803520-1-dlemoal@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Device mapper may create a non-zoned mapped device out of a zoned device (e.g., the dm-zoned target). In such case, some queue limit such as the max_zone_append_sectors and zone_write_granularity endup being non zero values for a block device that is not zoned. Avoid this by clearing these limits in blk_stack_limits() when the stacked zoned limit is false. Fixes: 3093a479727b ("block: inherit the zoned characteristics in blk_stack_limits") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal --- block/blk-settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index 06ea91e51b8b..5adadce08408 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -689,6 +689,10 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, t->zone_write_granularity = max(t->zone_write_granularity, b->zone_write_granularity); t->zoned = max(t->zoned, b->zoned); + if (!t->zoned) { + t->zone_write_granularity = 0; + t->max_zone_append_sectors = 0; + } return ret; } EXPORT_SYMBOL(blk_stack_limits); From patchwork Thu Feb 22 13:17:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 13567315 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0343345975 for ; Thu, 22 Feb 2024 13:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607848; cv=none; b=eRpIQ1K13KC3p527GRqRLmerObW/WPSXmDIgbvvyD2qMmxVWzkR9WN1jWCRrjELMivM6V2ULti/ZT1GD+bkxKoewkJ4szN6nuHMPtFSF7IwW0C22QWAObBUxBh3ailV9sdcvWYKR4Dj++3DnhRoOuDyUSW0cESAoNzcpvCXnY3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607848; c=relaxed/simple; bh=LWzkY52cx0OgubpMQI1Cia1CymcN8g3jPSZxdG7ZJ30=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QPErXaZgbHReruJEi0XX1Z5brjOblQieWGwnr1IjeEkYuqS+5mn1/+pI7nIwX/QFG0JNKBauO/wYuvr26E1xb8izjia/PsmOaxl71o1mu6egp8Um2i8/u+kPGCrKhMyyHgtn0UctzqCySJBrxd/ny+PpACxVTOTDxEPgVNQewX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RVsAQJgy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RVsAQJgy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5E4EC433C7; Thu, 22 Feb 2024 13:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708607847; bh=LWzkY52cx0OgubpMQI1Cia1CymcN8g3jPSZxdG7ZJ30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVsAQJgyEOzNTu5wiJ00c5rN3dFe1PMh27tqTKQrhv+XIv46VyxG+R3qE3tfG0t6p vkX2xqD51NRWS2UDCyEsODOpjzH5zZ1ycvhdXVWqQzJHPNtp5IlOWrCx9XuJ5ayivV 4x+q6SRgHQpWhy+e2/E2kPDCPJMdYKNQlnUs/7rSkjEALRlcw1fil26ulLqiQydHs3 k54Yio1uop2UKq1hAFDtv/chWCgMrbx2tKHMqIQr4ZMwDIb78l5X2r6y4D9DRFf3Kv AjpDtjLtBou1VjWizE+kobOSXa1ppfeooiuVIcJO1bofRuFrTn0OoU1US2vT9DpjIr LwIc7OhrhVcWg== From: Damien Le Moal To: Jens Axboe , linux-block@vger.kernel.org Cc: Christoph Hellwig Subject: [PATCH 2/2] block: Do not include rbtree.h in blk-zoned.c Date: Thu, 22 Feb 2024 22:17:24 +0900 Message-ID: <20240222131724.1803520-2-dlemoal@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240222131724.1803520-1-dlemoal@kernel.org> References: <20240222131724.1803520-1-dlemoal@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The block zone code does not use RB-tree. So remove the include of linux/rbtree.h as it is not needed. Signed-off-by: Damien Le Moal Reviewed-by: Bart Van Assche --- block/blk-zoned.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index d343e5756a9c..fa930881b06b 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include