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.

ublk: don't clear GD_SUPPRESS_PART_SCAN for unprivileged daemons

When UBLK_F_NO_AUTO_PART_SCAN is set, GD_SUPPRESS_PART_SCAN is cleared
unconditionally, including for unprivileged daemons. Keep it consistent
with the code block for setting GD_SUPPRESS_PART_SCAN by not clearing
it for unprivileged daemons.

In reality this isn't a problem because ioctl(BLKRRPART) requires
CAP_SYS_ADMIN, but it is more reliable to not clear the bit.

Cc: Alexander Atanasov <alex@zazolabs.com>
Fixes: 8443e2087e70 ("ublk: add UBLK_F_NO_AUTO_PART_SCAN feature flag")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
155a3bed 25966fc0

+3 -1
+3 -1
drivers/block/ublk_drv.c
··· 4440 4440 4441 4441 /* Skip partition scan if disabled by user */ 4442 4442 if (ub->dev_info.flags & UBLK_F_NO_AUTO_PART_SCAN) { 4443 - clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state); 4443 + /* Not clear for unprivileged daemons, see comment above */ 4444 + if (!ub->unprivileged_daemons) 4445 + clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state); 4444 4446 } else { 4445 4447 /* Schedule async partition scan for trusted daemons */ 4446 4448 if (!ub->unprivileged_daemons)