]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/heartbeat.c
usermodehelper: Tidy up waiting
[~andy/linux] / fs / ocfs2 / heartbeat.c
index 8fc52d6d0ce7827a75f40f40986f9ea8ef07b752..c4c36171240d0555d5db10d0edb341c2a52627c9 100644 (file)
@@ -157,15 +157,17 @@ int ocfs2_register_hb_callbacks(struct ocfs2_super *osb)
        if (ocfs2_mount_local(osb))
                return 0;
 
-       status = o2hb_register_callback(&osb->osb_hb_down);
+       status = o2hb_register_callback(osb->uuid_str, &osb->osb_hb_down);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
        }
 
-       status = o2hb_register_callback(&osb->osb_hb_up);
-       if (status < 0)
+       status = o2hb_register_callback(osb->uuid_str, &osb->osb_hb_up);
+       if (status < 0) {
                mlog_errno(status);
+               o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_down);
+       }
 
 bail:
        return status;
@@ -173,18 +175,11 @@ bail:
 
 void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb)
 {
-       int status;
-
        if (ocfs2_mount_local(osb))
                return;
 
-       status = o2hb_unregister_callback(&osb->osb_hb_down);
-       if (status < 0)
-               mlog_errno(status);
-
-       status = o2hb_unregister_callback(&osb->osb_hb_up);
-       if (status < 0)
-               mlog_errno(status);
+       o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_down);
+       o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_up);
 }
 
 void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
@@ -214,7 +209,7 @@ void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
        envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
        envp[2] = NULL;
 
-       ret = call_usermodehelper(argv[0], argv, envp, 1);
+       ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
        if (ret < 0)
                mlog_errno(ret);
 }