Skip to content

Commit f1ff4de

Browse files
t-8chvijay-suman
authored andcommitted
loop: LOOP_SET_FD: send uevents for partitions
commit 0dba7a05b9e47d8b546399117b0ddf2426dc6042 upstream. 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: [email protected] Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 6b563dc85fb3f482f37c88d386d058916c03c621) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 9632859 commit f1ff4de

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
@@ -792,19 +792,20 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
792792
* dependency.
793793
*/
794794
fput(old_file);
795+
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
795796
if (partscan)
796797
loop_reread_partitions(lo);
797798

798799
error = 0;
799800
done:
800-
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
801801
kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE);
802802
return error;
803803

804804
out_err:
805805
loop_global_unlock(lo, is_loop);
806806
out_putf:
807807
fput(file);
808+
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
808809
goto done;
809810
}
810811

0 commit comments

Comments
 (0)