Linux block layer
 help / color / mirror / Atom feed
* [PATCH] block: stack zoned resource limits
@ 2026-05-20  9:12 Yao Sang
  2026-05-21  3:54 ` Shin'ichiro Kawasaki
  2026-05-31  9:45 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Yao Sang @ 2026-05-20  9:12 UTC (permalink / raw)
  To: linux-block; +Cc: Jens Axboe, Yao Sang

This was found while debugging a zoned NVMe multipath setup, where the
namespace head reported 0/0 for max_open_zones and max_active_zones
while the live path still reported finite limits.

blk_stack_limits() already combines several zoned queue limits, but it
leaves max_open_zones and max_active_zones unchanged. Since 0 means "no
limit" for both values, stacked zoned devices can preserve bogus 0/0
limits even when the underlying queue advertises finite values.

Stack max_open_zones and max_active_zones with min_not_zero(), and
clear them when the resulting queue is not zoned.

Signed-off-by: Yao Sang <sangyao@kylinos.cn>
---
 block/blk-settings.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index 78c83817b9d3..88b6c3703101 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -814,6 +814,10 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
 
 	t->max_hw_zone_append_sectors = min(t->max_hw_zone_append_sectors,
 					b->max_hw_zone_append_sectors);
+	t->max_open_zones = min_not_zero(t->max_open_zones,
+				       b->max_open_zones);
+	t->max_active_zones = min_not_zero(t->max_active_zones,
+					 b->max_active_zones);
 
 	t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask,
 					    b->seg_boundary_mask);
@@ -921,6 +925,8 @@ 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);
 	if (!(t->features & BLK_FEAT_ZONED)) {
+		t->max_open_zones = 0;
+		t->max_active_zones = 0;
 		t->zone_write_granularity = 0;
 		t->max_zone_append_sectors = 0;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-31  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  9:12 [PATCH] block: stack zoned resource limits Yao Sang
2026-05-21  3:54 ` Shin'ichiro Kawasaki
2026-05-31  9:45 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox