Skip to content

Commit 2b9ac22

Browse files
klausenbuskaxboe
authored andcommitted
loop: Fix missing discard support when using LOOP_CONFIGURE
Without calling loop_config_discard() the discard flag and parameters aren't set/updated for the loop device and worst-case they could indicate discard support when it isn't the case (ex: if the LOOP_SET_STATUS ioctl was used with a different file prior to LOOP_CONFIGURE). Cc: <[email protected]> # 5.8.x- Fixes: 3448914 ("loop: Add LOOP_CONFIGURE ioctl") Signed-off-by: Kristian Klausen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent e0d245e commit 2b9ac22

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
11541154
blk_queue_physical_block_size(lo->lo_queue, bsize);
11551155
blk_queue_io_min(lo->lo_queue, bsize);
11561156

1157+
loop_config_discard(lo);
11571158
loop_update_rotational(lo);
11581159
loop_update_dio(lo);
11591160
loop_sysfs_init(lo);

0 commit comments

Comments
 (0)