Blame SOURCES/nfs-utils-2.3.3-statd-no-notify.patch

c88dcf
commit 5394f939b591e65fec37a6bee826c13620d3f39b
c88dcf
Author: Justin Mitchell <jumitche@redhat.com>
c88dcf
Date:   Mon Mar 4 11:53:09 2019 -0500
c88dcf
c88dcf
    Add nfs.conf equivalent for the statd --no-notify cmdline option
c88dcf
    
c88dcf
    Also cleaned up how nfs.conf is read.
c88dcf
    
c88dcf
    Signed-off-by: Justin Mitchell <jumitche@redhat.com>
c88dcf
    Signed-off-by: Steve Dickson <steved@redhat.com>
c88dcf
c88dcf
diff --git a/nfs.conf b/nfs.conf
c88dcf
index f1ebfdb..d332375 100644
c88dcf
--- a/nfs.conf
c88dcf
+++ b/nfs.conf
c88dcf
@@ -62,6 +62,7 @@
c88dcf
 # name=
c88dcf
 # state-directory-path=/var/lib/nfs/statd
c88dcf
 # ha-callout=
c88dcf
+# no-notify=0
c88dcf
 #
c88dcf
 [sm-notify]
c88dcf
 # debug=0
c88dcf
diff --git a/utils/statd/statd.c b/utils/statd/statd.c
c88dcf
index 2cc6cf3..1467380 100644
c88dcf
--- a/utils/statd/statd.c
c88dcf
+++ b/utils/statd/statd.c
c88dcf
@@ -238,6 +238,39 @@ static void set_nlm_port(char *type, int port)
c88dcf
 		fprintf(stderr, "%s: failed to open %s: %s\n", 
c88dcf
 			name_p, pathbuf, strerror(errno));
c88dcf
 }
c88dcf
+int port = 0, out_port = 0;
c88dcf
+int nlm_udp = 0, nlm_tcp = 0;
c88dcf
+
c88dcf
+inline static void 
c88dcf
+read_nfsconf(char **argv)
c88dcf
+{
c88dcf
+	char *s;
c88dcf
+
c88dcf
+	conf_init_file(NFS_CONFFILE);
c88dcf
+	xlog_from_conffile("statd");
c88dcf
+
c88dcf
+	out_port = conf_get_num("statd", "outgoing-port", out_port);
c88dcf
+	port = conf_get_num("statd", "port", port);
c88dcf
+
c88dcf
+	MY_NAME = conf_get_str("statd", "name");
c88dcf
+	if (MY_NAME)
c88dcf
+		run_mode |= STATIC_HOSTNAME;
c88dcf
+
c88dcf
+	s = conf_get_str("statd", "state-directory-path");
c88dcf
+	if (s && !nsm_setup_pathnames(argv[0], s))
c88dcf
+		exit(1);
c88dcf
+
c88dcf
+	s = conf_get_str("statd", "ha-callout");
c88dcf
+	if (s)
c88dcf
+		ha_callout_prog = s;
c88dcf
+
c88dcf
+	nlm_tcp = conf_get_num("lockd", "port", nlm_tcp);
c88dcf
+	/* udp defaults to the same as tcp ! */
c88dcf
+	nlm_udp = conf_get_num("lockd", "udp-port", nlm_tcp);
c88dcf
+
c88dcf
+	if (conf_get_bool("statd", "no-notify", false))
c88dcf
+		run_mode |= MODE_NO_NOTIFY;
c88dcf
+}
c88dcf
 
c88dcf
 /*
c88dcf
  * Entry routine/main loop.
c88dcf
@@ -245,11 +278,8 @@ static void set_nlm_port(char *type, int port)
c88dcf
 int main (int argc, char **argv)
c88dcf
 {
c88dcf
 	extern char *optarg;
c88dcf
-	char *s;
c88dcf
 	int pid;
c88dcf
 	int arg;
c88dcf
-	int port = 0, out_port = 0;
c88dcf
-	int nlm_udp = 0, nlm_tcp = 0;
c88dcf
 	struct rlimit rlim;
c88dcf
 	int notify_sockfd;
c88dcf
 	char *env;
c88dcf
@@ -275,23 +305,8 @@ int main (int argc, char **argv)
c88dcf
 	/* Set hostname */
c88dcf
 	MY_NAME = NULL;
c88dcf
 
c88dcf
-	conf_init_file(NFS_CONFFILE);
c88dcf
-	xlog_from_conffile("statd");
c88dcf
-	out_port = conf_get_num("statd", "outgoing-port", out_port);
c88dcf
-	port = conf_get_num("statd", "port", port);
c88dcf
-	MY_NAME = conf_get_str("statd", "name");
c88dcf
-	if (MY_NAME)
c88dcf
-		run_mode |= STATIC_HOSTNAME;
c88dcf
-	s = conf_get_str("statd", "state-directory-path");
c88dcf
-	if (s && !nsm_setup_pathnames(argv[0], s))
c88dcf
-		exit(1);
c88dcf
-	s = conf_get_str("statd", "ha-callout");
c88dcf
-	if (s)
c88dcf
-		ha_callout_prog = s;
c88dcf
-
c88dcf
-	nlm_tcp = conf_get_num("lockd", "port", nlm_tcp);
c88dcf
-	/* udp defaults to the same as tcp ! */
c88dcf
-	nlm_udp = conf_get_num("lockd", "udp-port", nlm_tcp);
c88dcf
+	/* Read nfs.conf */
c88dcf
+	read_nfsconf(argv);
c88dcf
 
c88dcf
 	/* Process command line switches */
c88dcf
 	while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:LT:U:", longopts, NULL)) != EOF) {