Skip to content

Commit fe6a8fc

Browse files
Lennart Poetteringaxboe
authored andcommitted
loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE
When LOOP_CONFIGURE is used with LO_FLAGS_PARTSCAN we need to propagate this into the GENHD_FL_NO_PART_SCAN. LOOP_SETSTATUS does this, LOOP_CONFIGURE doesn't so far. Effect is that setting up a loopback device with partition scanning doesn't actually work when LOOP_CONFIGURE is issued, though it works fine with LOOP_SETSTATUS. Let's correct that and propagate the flag in LOOP_CONFIGURE too. Fixes: 3448914("loop: Add LOOP_CONFIGURE ioctl") Signed-off-by: Lennart Poettering <[email protected]> Acked-by: Martijn Coenen <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 905e321 commit fe6a8fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/block/loop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
11711171
if (part_shift)
11721172
lo->lo_flags |= LO_FLAGS_PARTSCAN;
11731173
partscan = lo->lo_flags & LO_FLAGS_PARTSCAN;
1174+
if (partscan)
1175+
lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
11741176

11751177
/* Grab the block_device to prevent its destruction after we
11761178
* put /dev/loopXX inode. Later in __loop_clr_fd() we bdput(bdev).

0 commit comments

Comments
 (0)