Patchwork [Oneiric,8/8] UBUNTU: SAUCE: fsam7400: use UMH_WAIT_PROC consistently

login
register
mail settings
Submitter Tim Gardner
Date March 26, 2012, 1:28 a.m.
Message ID <1332725337-58475-8-git-send-email-tim.gardner@canonical.com>
Download mbox | patch
Permalink /patch/148623/
State New
Headers show

Comments

Tim Gardner - March 26, 2012, 1:28 a.m.
BugLink: http://bugs.launchpad.net/bugs/963685

Inspired by Testuo Handa, "usermodehelper: use UMH_WAIT_PROC consistently"

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 ubuntu/fsam7400/fsam7400.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Tetsuo Handa - March 26, 2012, 2:01 a.m.
Maybe I've missed some users. Please check that all users are using UMH_*
constants. For example, linux-ubuntu-modules-2.6.24_2.6.24-31.51.tar.gz has
several hardcoded users.

# grep -Fr -A 3 _usermodehelper .
./ubuntu/wireless/fsam7400.c:    status = call_usermodehelper(argv[0], argv, envp, 1);
./ubuntu/wireless/fsam7400.c-  } else {
./ubuntu/wireless/fsam7400.c-    char *argv[] = { "/sbin/rmmod", "ipw2100", NULL };
./ubuntu/wireless/fsam7400.c-    mode = "removing";
./ubuntu/wireless/fsam7400.c:    status = call_usermodehelper(argv[0], argv, envp, 1);
--
./ubuntu/wireless/p80211/p80211netdev.c:        return call_usermodehelper(argv [0], argv, envp);
./ubuntu/wireless/p80211/p80211netdev.c-#else
./ubuntu/wireless/p80211/p80211netdev.c:        return call_usermodehelper(argv [0], argv, envp, 0);
--
./ubuntu/wireless/rtl8187-usb/rtl8187/r8187_core.c:                                call_usermodehelper(RadioPowerPath,argv,envp,1);
--
./ubuntu/block/drbd/drbd_nl.c:  return call_usermodehelper(usermode_helper,argv,envp,1);
./ubuntu/block/drbd/drbd_nl.c-}
./ubuntu/block/drbd/drbd_nl.c-
./ubuntu/block/drbd/drbd_nl.c-drbd_disks_t drbd_try_outdate_peer(drbd_dev *mdev)
--
./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
./ubuntu/misc/ndiswrapper/loader.c-#endif
--
./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
./ubuntu/misc/ndiswrapper/loader.c-#endif
--
./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
./ubuntu/misc/ndiswrapper/loader.c-#endif

UMH_* renumbering patch changes meaning of hardcoded "1" from UMH_WAIT_PROC to
UMH_WAIT_EXEC. If you failed to convert, you will receive regression reports
that usermode application no longer waits for completion.
Tim Gardner - March 26, 2012, 11:47 a.m.
On 03/25/2012 08:01 PM, Tetsuo Handa wrote:
> Maybe I've missed some users. Please check that all users are using UMH_*
> constants. For example, linux-ubuntu-modules-2.6.24_2.6.24-31.51.tar.gz has
> several hardcoded users.
> 
> # grep -Fr -A 3 _usermodehelper .
> ./ubuntu/wireless/fsam7400.c:    status = call_usermodehelper(argv[0], argv, envp, 1);
> ./ubuntu/wireless/fsam7400.c-  } else {
> ./ubuntu/wireless/fsam7400.c-    char *argv[] = { "/sbin/rmmod", "ipw2100", NULL };
> ./ubuntu/wireless/fsam7400.c-    mode = "removing";
> ./ubuntu/wireless/fsam7400.c:    status = call_usermodehelper(argv[0], argv, envp, 1);
> --
> ./ubuntu/wireless/p80211/p80211netdev.c:        return call_usermodehelper(argv [0], argv, envp);
> ./ubuntu/wireless/p80211/p80211netdev.c-#else
> ./ubuntu/wireless/p80211/p80211netdev.c:        return call_usermodehelper(argv [0], argv, envp, 0);
> --
> ./ubuntu/wireless/rtl8187-usb/rtl8187/r8187_core.c:                                call_usermodehelper(RadioPowerPath,argv,envp,1);
> --
> ./ubuntu/block/drbd/drbd_nl.c:  return call_usermodehelper(usermode_helper,argv,envp,1);
> ./ubuntu/block/drbd/drbd_nl.c-}
> ./ubuntu/block/drbd/drbd_nl.c-
> ./ubuntu/block/drbd/drbd_nl.c-drbd_disks_t drbd_try_outdate_peer(drbd_dev *mdev)
> --
> ./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
> ./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> ./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
> ./ubuntu/misc/ndiswrapper/loader.c-#endif
> --
> ./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
> ./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> ./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
> ./ubuntu/misc/ndiswrapper/loader.c-#endif
> --
> ./ubuntu/misc/ndiswrapper/loader.c:             ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
> ./ubuntu/misc/ndiswrapper/loader.c-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> ./ubuntu/misc/ndiswrapper/loader.c-                                       , 1
> ./ubuntu/misc/ndiswrapper/loader.c-#endif
> 
> UMH_* renumbering patch changes meaning of hardcoded "1" from UMH_WAIT_PROC to
> UMH_WAIT_EXEC. If you failed to convert, you will receive regression reports
> that usermode application no longer waits for completion.

You didn't miss  them, but I did. Thanks for the note. I'll send a
followup patch for these out of tree drivers.

rtg

Patch

diff --git a/ubuntu/fsam7400/fsam7400.c b/ubuntu/fsam7400/fsam7400.c
index cbc40b8..c08e638 100644
--- a/ubuntu/fsam7400/fsam7400.c
+++ b/ubuntu/fsam7400/fsam7400.c
@@ -222,11 +222,11 @@  static inline void do_ipw2100_loading(int state)
   if (state == RADIO_ON) {
     char *argv[] = { "/sbin/modprobe", "-s", "-k", "ipw2100", NULL };
     mode = "loading";
-    status = call_usermodehelper(argv[0], argv, envp, 1);
+    status = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
   } else {
     char *argv[] = { "/sbin/rmmod", "ipw2100", NULL };
     mode = "removing";
-    status = call_usermodehelper(argv[0], argv, envp, 1);
+    status = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
   }
   DEBUG_OUT2("%s of ipw2100 module %s\n", mode, status == 0 ? "successful" : "FAILED");
 }