Skip to content

Commit ad320ae

Browse files
bmarzinsMikulas Patocka
authored andcommitted
dm: fix native zone append devices on top of emulated ones
If a DM device that can pass down zone append commands is stacked on top of a device that emulates zone append commands, it will allocate zone append emulation resources, even though it doesn't use them. This is because the underlying device will have max_hw_zone_append_sectors set to 0 to request zone append emulation. When the DM device is stacked on top of it, it will inherit that max_hw_zone_append_sectors limit, despite being able to pass down zone append bios. Solve this by making sure max_hw_zone_append_sectors is non-zero for DM devices that do not need zone append emulation. Reviewed-by: Damien Le Moal <[email protected]> Tested-by: Damien Le Moal <[email protected]> Signed-off-by: Benjamin Marzinski <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 121218b commit ad320ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/md/dm-zone.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,15 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q,
347347

348348
/*
349349
* Check if zone append is natively supported, and if not, set the
350-
* mapped device queue as needing zone append emulation.
350+
* mapped device queue as needing zone append emulation. If zone
351+
* append is natively supported, make sure that
352+
* max_hw_zone_append_sectors is not set to 0.
351353
*/
352354
WARN_ON_ONCE(queue_is_mq(q));
353355
if (!dm_table_supports_zone_append(t))
354356
lim->max_hw_zone_append_sectors = 0;
357+
else if (lim->max_hw_zone_append_sectors == 0)
358+
lim->max_hw_zone_append_sectors = lim->max_zone_append_sectors;
355359

356360
/*
357361
* Determine the max open and max active zone limits for the mapped

0 commit comments

Comments
 (0)