On Tue 15-04-25 13:07:48, Thomas Weißschuh wrote:
On Tue, Apr 15, 2025 at 12:24:55PM +0200, Jan Kara wrote:
On Tue 15-04-25 10:51:47, Thomas Weißschuh wrote:
The original commit message and the wording "uncork" in the code comment indicate that it is expected that the suppressed event instances are automatically sent after unsuppressing. This is not the case, instead they are discarded. In effect this means that no "changed" events are emitted on the device itself by default. While each discovered partition does trigger a changed event on the device, devices without partitions don't have any event emitted.
This makes udev miss the device creation and prompted workarounds in userspace. See the linked util-linux/losetup bug.
Explicitly emit the events and drop the confusingly worded comments.
Link: https://github.com/util-linux/util-linux/issues/2434 Fixes: 498ef5c777d9 ("loop: suppress uevents while reconfiguring the device") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de
Thanks for the fix! When reading the code, I'm a bit curious: What is actually generating events for partitions with loop_change_fd() call? Because there loop_reread_partitions() still happens with uevents supressed... I suspect event supressing there should be shorter.
Makes sense. For loop_configure() this was fixed in commit bb430b694226 ("loop: LOOP_CONFIGURE: send uevents for partitions"). I guess we need the same for loop_change_fd().
I'm not entirely sure on how to order the commits or if they should be folded together. My current preference is to first have the current patch under discussion and then the fix for loop_change_fd().
Yeah, whatever. I was asking mainly to make sure my understanding of the current code is correct :). With this one feel free to add:
Reviewed-by: Jan Kara jack@suse.cz
Honza