Skip to content

Commit 0dba7a0

Browse files
t-8chaxboe
authored andcommitted
loop: LOOP_SET_FD: send uevents for partitions
Remove the suppression of the uevents before scanning for partitions. The partitions inherit their suppression settings from their parent device, which lead to the uevents being dropped. This is similar to the same changes for LOOP_CONFIGURE done in commit bb430b6 ("loop: LOOP_CONFIGURE: send uevents for partitions"). Fixes: 498ef5c ("loop: suppress uevents while reconfiguring the device") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20250415-loop-uevent-changed-v3-1-60ff69ac6088@linutronix.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e7bc001 commit 0dba7a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/block/loop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,19 +662,20 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
662662
* dependency.
663663
*/
664664
fput(old_file);
665+
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
665666
if (partscan)
666667
loop_reread_partitions(lo);
667668

668669
error = 0;
669670
done:
670-
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
671671
kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE);
672672
return error;
673673

674674
out_err:
675675
loop_global_unlock(lo, is_loop);
676676
out_putf:
677677
fput(file);
678+
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
678679
goto done;
679680
}
680681

0 commit comments

Comments
 (0)