Skip to contentSkip to conversation

block: Clear zone limits for a non-zoned stacked queue

PATCH Applied Damien Le Moal 3 participants 4 messages Feb 22, 2024

Subsystems (2)
lore
Share & tools
lore

Damien Le Moal

author maintainer
#0 lore raw

PATCH 1/2 block: Clear zone limits for a non-zoned stacked queue

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")
---
 block/blk-settings.c | 4 ++++
 1 file changed, 4 insertions(+)
block/blk-settings.c +4 -0
index 06ea91e51b8b..5adadce08408 100644
@@ -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);
Signature · 1 line
2.43.2
author maintainer
#1 lore raw

PATCH 2/2 block: Do not include rbtree.h in blk-zoned.c

The block zone code does not use RB-tree. So remove the include of linux/rbtree.h as it is not needed.

---
 block/blk-zoned.c | 1 -
 1 file changed, 1 deletion(-)
block/blk-zoned.c +0 -1
index d343e5756a9c..fa930881b06b 100644
@@ -11,7 +11,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/rbtree.h>
 #include <linux/blkdev.h>
 #include <linux/blk-mq.h>
 #include <linux/mm.h>
Signature · 1 line
2.43.2
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] block: Do not include rbtree.h in blk-zoned.c

Quoted 2 lines · Damien Le Moal

The block zone code does not use RB-tree. So remove the include of linux/rbtree.h as it is not needed.

maintainer Applied
#3 lore raw
In reply to Damien Le Moal
Quoted 8 lines · Damien Le Moal

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.

[...]

Applied, thanks!

[1/2] block: Clear zone limits for a non-zoned stacked queue

      commit: c8f6f88d25929ad2f290b428efcae3b526f3eab0
[2/2] block: Do not include rbtree.h in blk-zoned.c
      commit: 522d73526f8d4519eefc693204bb474391e60f2b

Best regards,

Signature · 1 line
Jens Axboe