]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
loop: LOOP_SET_FD: send uevents for partitions
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Tue, 15 Apr 2025 14:55:06 +0000 (16:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:43:54 +0000 (10:43 +0200)
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 bb430b694226 ("loop: LOOP_CONFIGURE: send uevents for partitions").

Fixes: 498ef5c777d9 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/loop.c

index 2235442e393805471c612cac3aafc5137309f5a3..1c356bda9dfa8a079bbc8bbc97d8f6da63a9a57d 100644 (file)
@@ -624,12 +624,12 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
         * dependency.
         */
        fput(old_file);
+       dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
        if (partscan)
                loop_reread_partitions(lo);
 
        error = 0;
 done:
-       dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
        kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE);
        return error;
 
@@ -637,6 +637,7 @@ out_err:
        loop_global_unlock(lo, is_loop);
 out_putf:
        fput(file);
+       dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
        goto done;
 }