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: 3448914e8cc5("loop: Add LOOP_CONFIGURE ioctl")

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Martijn Coenen <maco@android.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by Lennart Poettering and committed by Jens Axboe fe6a8fc5 905e321e

Changed files
+2
drivers
block
+2
drivers/block/loop.c
··· 1171 1171 if (part_shift) 1172 1172 lo->lo_flags |= LO_FLAGS_PARTSCAN; 1173 1173 partscan = lo->lo_flags & LO_FLAGS_PARTSCAN; 1174 + if (partscan) 1175 + lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN; 1174 1176 1175 1177 /* Grab the block_device to prevent its destruction after we 1176 1178 * put /dev/loopXX inode. Later in __loop_clr_fd() we bdput(bdev).