mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 02:06:15 +01:00
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: 8443e2087e ("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>
This commit is contained in:
parent
25966fc097
commit
155a3bedcc
1 changed files with 3 additions and 1 deletions
|
|
@ -4440,7 +4440,9 @@ static int ublk_ctrl_start_dev(struct ublk_device *ub,
|
|||
|
||||
/* Skip partition scan if disabled by user */
|
||||
if (ub->dev_info.flags & UBLK_F_NO_AUTO_PART_SCAN) {
|
||||
clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
|
||||
/* Not clear for unprivileged daemons, see comment above */
|
||||
if (!ub->unprivileged_daemons)
|
||||
clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
|
||||
} else {
|
||||
/* Schedule async partition scan for trusted daemons */
|
||||
if (!ub->unprivileged_daemons)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue