]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: suppress sending MODALIAS in UNBIND uevents
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 13 Sep 2017 23:29:48 +0000 (16:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2017 14:48:33 +0000 (16:48 +0200)
commit311fc1f07a34638410436df6b33b9ae78793986f
tree50f2bc55120a88d9891866526c5a56ebb2ac1898
parent384fde7ed224f283f11ef2a592b05d4a29492aa8
driver core: suppress sending MODALIAS in UNBIND uevents

The current udev rules cause modules to be loaded on all device events save
for "remove". With the introduction of KOBJ_BIND/KOBJ_UNBIND this causes
issues, as driver modules that have devices bound to their drivers get
immediately reloaded, and it appears to the user that module unloading doe
snot work.

The standard udev matching rule is foillowing:

ENV{MODALIAS}=="?*", RUN{builtin}+="kmod load $env{MODALIAS}"

Given that MODALIAS data is not terribly useful for UNBIND event, let's zap
it from the generated uevent environment until we get userspace updated
with the correct udev rule that only loads modules on "add" event.

Reported-by: Jakub Kicinski <kubakici@wp.pl>
Tested-by: Jakub Kicinski <kubakici@wp.pl>
Fixes: 6ba3148ad2b4 ("driver core: emit uevents when device is bound ...")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/kobject_uevent.c