diff options
author | Christoph Hellwig <hch@lst.de> | 2024-06-17 08:04:31 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-06-19 07:58:27 -0600 |
commit | c9055b44abe60da69aa4ee4fdcb78ee7fe733335 (patch) | |
tree | 226ceefd12d9034806a86bbfea19c1190a8ce809 | |
parent | 308ad58af49d6c4c3b7a36b98972cc9db4d7b36a (diff) | |
download | linux-stable-c9055b44abe60da69aa4ee4fdcb78ee7fe733335.tar.gz linux-stable-c9055b44abe60da69aa4ee4fdcb78ee7fe733335.tar.bz2 linux-stable-c9055b44abe60da69aa4ee4fdcb78ee7fe733335.zip |
loop: stop using loop_reconfigure_limits in __loop_clr_fd
__loop_clr_fd wants to clear all settings on the device. Prepare for
moving more settings into the block limits by open coding
loop_reconfigure_limits.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240617060532.127975-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/loop.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 93780f41646b..fd671028fa85 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1133,6 +1133,7 @@ out_putf: static void __loop_clr_fd(struct loop_device *lo, bool release) { + struct queue_limits lim; struct file *filp; gfp_t gfp = lo->old_gfp_mask; @@ -1156,7 +1157,14 @@ static void __loop_clr_fd(struct loop_device *lo, bool release) lo->lo_offset = 0; lo->lo_sizelimit = 0; memset(lo->lo_file_name, 0, LO_NAME_SIZE); - loop_reconfigure_limits(lo, 512, false); + + /* reset the block size to the default */ + lim = queue_limits_start_update(lo->lo_queue); + lim.logical_block_size = SECTOR_SIZE; + lim.physical_block_size = SECTOR_SIZE; + lim.io_min = SECTOR_SIZE; + queue_limits_commit_update(lo->lo_queue, &lim); + invalidate_disk(lo->lo_disk); loop_sysfs_exit(lo); /* let user-space know about this change */ |