Hi Mike Could you send this to Linus before v5.9 is released? Mikulas From: Mikulas Patocka <mpatocka@xxxxxxxxxx> If q->limits.discard_granularity is zero, the block core will warn in __blkdev_issue_discard. This patch sets it to a minimum - 512 bytes. Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> Fixes: b35fd7422c2f ("block: check queue's limits.discard_granularity in __blkdev_issue_discard()") Fixes: 9b15d109a6b2 ("block: improve discard bio alignment in __blkdev_issue_discard()") Fixes: c52abf563049 ("loop: Better discard support for block devices") --- drivers/md/dm-table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Index: linux-2.6/drivers/md/dm-table.c =================================================================== --- linux-2.6.orig/drivers/md/dm-table.c 2020-08-31 12:08:27.000000000 +0200 +++ linux-2.6/drivers/md/dm-table.c 2020-09-24 16:23:55.000000000 +0200 @@ -1858,8 +1858,11 @@ void dm_table_set_restrictions(struct dm q->limits.discard_granularity = 0; q->limits.discard_alignment = 0; q->limits.discard_misaligned = 0; - } else + } else { blk_queue_flag_set(QUEUE_FLAG_DISCARD, q); + if (q->limits.discard_granularity < 512) + q->limits.discard_granularity = 512; + } if (dm_table_supports_secure_erase(t)) blk_queue_flag_set(QUEUE_FLAG_SECERASE, q); -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel