diff options
author | Christoph Hellwig <hch@lst.de> | 2024-05-27 14:36:20 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-05-27 09:16:39 -0600 |
commit | c8c1f7012b807ca4da0136eacab96961b56f25d5 (patch) | |
tree | fcd761caea1cb4f9560dea53799287cc3f939f82 /drivers/md/dm-table.c | |
parent | 5e7a4bbcc33d7df6bcc8565a8938c196285e5423 (diff) | |
download | linux-stable-c8c1f7012b807ca4da0136eacab96961b56f25d5.tar.gz linux-stable-c8c1f7012b807ca4da0136eacab96961b56f25d5.tar.bz2 linux-stable-c8c1f7012b807ca4da0136eacab96961b56f25d5.zip |
dm: make dm_set_zones_restrictions work on the queue limits
Don't stuff the values directly into the queue without any
synchronization, but instead delay applying the queue limits in
the caller and let dm_set_zones_restrictions work on the limit
structure.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240527123634.1116952-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index e291b78b307b..b2d5246cff21 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1981,10 +1981,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, if (!dm_table_supports_secure_erase(t)) limits->max_secure_erase_sectors = 0; - r = queue_limits_set(q, limits); - if (r) - return r; - if (dm_table_supports_flush(t, (1UL << QUEUE_FLAG_WC))) { wc = true; if (dm_table_supports_flush(t, (1UL << QUEUE_FLAG_FUA))) @@ -2036,12 +2032,16 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, * For a zoned target, setup the zones related queue attributes * and resources necessary for zone append emulation if necessary. */ - if (blk_queue_is_zoned(q)) { - r = dm_set_zones_restrictions(t, q); + if (IS_ENABLED(CONFIG_BLK_DEV_ZONED) && limits->zoned) { + r = dm_set_zones_restrictions(t, q, limits); if (r) return r; } + r = queue_limits_set(q, limits); + if (r) + return r; + dm_update_crypto_profile(q, t); /* |