Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

loop: don't freeze the queue in loop_update_dio

All callers of loop_update_dio except for loop_configure already have the
queue frozen, and loop_configure works on an unbound device. Remove the
superfluous recursive freezing in loop_update_dio and add asserts for the
locking and freezing state instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250110073750.1582447-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
0cd719aa 3a693110

+4 -4
+4 -4
drivers/block/loop.c
··· 201 201 bool dio = lo->use_dio || (lo->lo_backing_file->f_flags & O_DIRECT); 202 202 bool use_dio = dio && lo_can_use_dio(lo); 203 203 204 + lockdep_assert_held(&lo->lo_mutex); 205 + WARN_ON_ONCE(lo->lo_state == Lo_bound && 206 + lo->lo_queue->mq_freeze_depth == 0); 207 + 204 208 if (lo->use_dio == use_dio) 205 209 return; 206 210 ··· 217 213 * LO_FLAGS_READ_ONLY, both are set from kernel, and losetup 218 214 * will get updated by ioctl(LOOP_GET_STATUS) 219 215 */ 220 - if (lo->lo_state == Lo_bound) 221 - blk_mq_freeze_queue(lo->lo_queue); 222 216 lo->use_dio = use_dio; 223 217 if (use_dio) 224 218 lo->lo_flags |= LO_FLAGS_DIRECT_IO; 225 219 else 226 220 lo->lo_flags &= ~LO_FLAGS_DIRECT_IO; 227 - if (lo->lo_state == Lo_bound) 228 - blk_mq_unfreeze_queue(lo->lo_queue); 229 221 } 230 222 231 223 /**