Re: [RFC PATCH] kobject: fix uevent helper execution order issues

From: Greg KH
Date: Tue Aug 19 2025 - 14:29:44 EST


On Wed, Aug 20, 2025 at 01:18:28AM +0800, zhoumin wrote:
> The current use of the UMH_NO_WAIT parameter does not guarantee the
> sequential execution of CONFIG_STATIC_USERMODEHELPER_PATH.

There is never any such guarantee. Unless you are on a single processor
system.

> For example, when fdisk completes and issues a BLKRRPART ioctl command,
> kernel first sending remove events followed by an add events. However,
> process CONFIG_STATIC_USERMODEHELPER_PATH may execute
> out-of-order—potentially handling the add before the remove. This can
> result in the new partition being unexpectedly unmounted instead of mounted
> as intended.

Why are you not looking at the SEQNUM value? That should be what orders
the events, right? Otherwise how would any of this work? :)

Also, what usermode helper program are you using that requires a binary?
What is wrong with udev?

thanks,

greg k-h