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 --- 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