Skip to contentSkip to conversation

sm-notify: always exiting without any notification

PATCH In review Steve Dickson 2 participants 3 messages Dec 6, 2008 – Dec 9, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sm-notify: always exiting without any notification

In my recent trials and tribulations on dealing with the state file I found this fairly obvious bug:

commit 5d8b800b8438222a55c4698c86b558b15717aa21

Author: Steve Dickson <[email protected]>
Date:   Sat Dec 6 08:31:29 2008 -0500

sm-notify: always exiting without any notification

Added curly brackets around the record_pid() check which stops sm-notify from exiting when a pid file does not exist.

utils/statd/sm-notify.c +2 -1
index 7a7ae1a..d8e2c01 100644
@@ -193,10 +193,11 @@ usage:		fprintf(stderr,
 	openlog("sm-notify", LOG_PID, LOG_DAEMON);
 
 	if (strcmp(_SM_BASE_PATH, BASEDIR) == 0) {
-		if (record_pid() == 0 && force == 0 && opt_update_state == 1)
+		if (record_pid() == 0 && force == 0 && opt_update_state == 1) {
 			/* already run, don't try again */
 			nsm_log(LOG_NOTICE, "Already notifying clients; Exiting!");
 			exit(0);
+		}
 	}
 
 	if (opt_srcaddr) {
#2 lore raw
In reply to a message not in the archive
Quoted 2 lines · Steve Dickson

In my recent trials and tribulations on dealing with the state file I found this fairly obvious bug:

Yipes. This code needs all the eyes it can get, I guess.

--b.

Quoted 34 lines

commit 5d8b800b8438222a55c4698c86b558b15717aa21

Author: Steve Dickson <[email protected]>
Date:   Sat Dec 6 08:31:29 2008 -0500

sm-notify: always exiting without any notification

Added curly brackets around the record_pid() check which stops sm-notify from exiting when a pid file does not exist.

utils/statd/sm-notify.c +2 -2
index 7a7ae1a..d8e2c01 100644
@@ -193,10 +193,11 @@ usage:		fprintf(stderr,
 	openlog("sm-notify", LOG_PID, LOG_DAEMON);
 
 	if (strcmp(_SM_BASE_PATH, BASEDIR) == 0) {
-		if (record_pid() == 0 && force == 0 && opt_update_state == 1)
+		if (record_pid() == 0 && force == 0 && opt_update_state == 1) {
 			/* already run, don't try again */
 			nsm_log(LOG_NOTICE, "Already notifying clients; Exiting!");
 			exit(0);
+		}
 	}
 
 	if (opt_srcaddr) {
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 5 lines · J. Bruce Fields
Quoted 2 lines · Steve Dickson

In my recent trials and tribulations on dealing with the state file I found this fairly obvious bug:

Yipes. This code needs all the eyes it can get, I guess.

Exactly.. the more eyes the better...

steved.