aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-11 17:11:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-11 17:11:28 -0700
commitbff4b74625fea851f9dd61e747a162d2f6b3317e (patch)
tree1a48e5fcabaf66d857123d55843e38d4780059d7
parentMerge tag 'x86-entry-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
downloadwireguard-linux-bff4b74625fea851f9dd61e747a162d2f6b3317e.tar.xz
wireguard-linux-bff4b74625fea851f9dd61e747a162d2f6b3317e.zip
Revert "dm: use queue_limits_set"
This reverts commit 8e0ef412869430d114158fc3b9b1fb111e247bd3. It's broken, and causes the boot to fail on encrypted volumes. Reported-and-bisected-by: Johannes Weiner <hannes@cmpxchg.org> Link: https://lore.kernel.org/all/20240311235023.GA1205@cmpxchg.org/ Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--block/blk-settings.c2
-rw-r--r--drivers/md/dm-table.c27
2 files changed, 16 insertions, 13 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 3c7d8d638ab5..e160d56e8eda 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -267,7 +267,7 @@ int queue_limits_commit_update(struct request_queue *q,
EXPORT_SYMBOL_GPL(queue_limits_commit_update);
/**
- * queue_limits_set - apply queue limits to queue
+ * queue_limits_commit_set - apply queue limits to queue
* @q: queue to update
* @lim: limits to apply
*
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 88114719fe18..41f1d731ae5a 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1963,27 +1963,26 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
bool wc = false, fua = false;
int r;
+ /*
+ * Copy table's limits to the DM device's request_queue
+ */
+ q->limits = *limits;
+
if (dm_table_supports_nowait(t))
blk_queue_flag_set(QUEUE_FLAG_NOWAIT, q);
else
blk_queue_flag_clear(QUEUE_FLAG_NOWAIT, q);
if (!dm_table_supports_discards(t)) {
- limits->max_hw_discard_sectors = 0;
- limits->discard_granularity = 0;
- limits->discard_alignment = 0;
- limits->discard_misaligned = 0;
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_hw_discard_sectors = 0;
+ q->limits.discard_granularity = 0;
+ q->limits.discard_alignment = 0;
+ q->limits.discard_misaligned = 0;
}
- if (!dm_table_supports_write_zeroes(t))
- limits->max_write_zeroes_sectors = 0;
-
if (!dm_table_supports_secure_erase(t))
- limits->max_secure_erase_sectors = 0;
-
- r = queue_limits_set(q, limits);
- if (r)
- return r;
+ q->limits.max_secure_erase_sectors = 0;
if (dm_table_supports_flush(t, (1UL << QUEUE_FLAG_WC))) {
wc = true;
@@ -2008,6 +2007,9 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
else
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
+ if (!dm_table_supports_write_zeroes(t))
+ q->limits.max_write_zeroes_sectors = 0;
+
dm_table_verify_integrity(t);
/*
@@ -2045,6 +2047,7 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
}
dm_update_crypto_profile(q, t);
+ disk_update_readahead(t->md->disk);
/*
* Check for request-based device is left to