summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2024-02-22 22:17:23 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-10 16:18:35 +0200
commitd05e6ba1b74aa689cf679a90bec5b180c28f4bd4 (patch)
tree730c45df23d996ab4ff339c40fe31cd1a572e28b /block
parent447753bdd69bdaa1963f195ff98b4299a46cfe8c (diff)
downloadlinux-d05e6ba1b74aa689cf679a90bec5b180c28f4bd4.tar.gz
linux-d05e6ba1b74aa689cf679a90bec5b180c28f4bd4.tar.bz2
linux-d05e6ba1b74aa689cf679a90bec5b180c28f4bd4.zip
block: Clear zone limits for a non-zoned stacked queue
[ Upstream commit c8f6f88d25929ad2f290b428efcae3b526f3eab0 ] 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 <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20240222131724.1803520-1-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-settings.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 959b5c1e6d3b..1b92e6624951 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -647,6 +647,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);