6014ca6
diff --git a/configure.ac b/configure.ac
6014ca6
index e82ff14..cf1c4b9 100644
6014ca6
--- a/configure.ac
6014ca6
+++ b/configure.ac
6014ca6
@@ -238,13 +238,6 @@ AC_ARG_ENABLE(nfsdcltrack,
6014ca6
 	enable_nfsdcltrack=$enableval,
6014ca6
 	enable_nfsdcltrack="yes")
6014ca6
 
6014ca6
-AC_ARG_ENABLE(osdlogin,
6014ca6
-	[AC_HELP_STRING([--enable-osdlogin],
6014ca6
-			[enable osd_login scripts @<:@default=no@:>@])],
6014ca6
-	enable_osdlogin=$enableval,
6014ca6
-	enable_osdlogin="no")
6014ca6
-	AM_CONDITIONAL(CONFIG_OSD_LOGIN, [test "$enable_osdlogin" = "yes" ])
6014ca6
-
6014ca6
 dnl Check for TI-RPC library and headers
6014ca6
 AC_LIBTIRPC
6014ca6
 
6014ca6
@@ -631,7 +624,6 @@ AC_CONFIG_FILES([
6014ca6
 	utils/nfsidmap/Makefile
6014ca6
 	utils/showmount/Makefile
6014ca6
 	utils/statd/Makefile
6014ca6
-	utils/osd_login/Makefile
6014ca6
 	systemd/Makefile
6014ca6
 	tests/Makefile
6014ca6
 	tests/nsm_client/Makefile])
6014ca6
diff --git a/nfs.conf b/nfs.conf
6014ca6
index 0d0ec9b..796bee4 100644
6014ca6
--- a/nfs.conf
6014ca6
+++ b/nfs.conf
6014ca6
@@ -2,15 +2,16 @@
6014ca6
 # This is a general configuration for the
6014ca6
 # NFS daemons and tools
6014ca6
 #
6014ca6
-#[general]
6014ca6
+[general]
6014ca6
 # pipefs-directory=/var/lib/nfs/rpc_pipefs
6014ca6
 #
6014ca6
-#[exportfs]
6014ca6
+[exportfs]
6014ca6
 # debug=0
6014ca6
 #
6014ca6
-#[gssd]
6014ca6
+[gssd]
6014ca6
 # use-memcache=0
6014ca6
 # use-machine-creds=1
6014ca6
+# use-gss-proxy=0
6014ca6
 # avoid-dns=1
6014ca6
 # limit-to-legacy-enctypes=0
6014ca6
 # context-timeout=0
6014ca6
@@ -19,11 +20,11 @@
6014ca6
 # cred-cache-directory=
6014ca6
 # preferred-realm=
6014ca6
 #
6014ca6
-#[lockd]
6014ca6
+[lockd]
6014ca6
 # port=0
6014ca6
 # udp-port=0
6014ca6
 #
6014ca6
-#[mountd]
6014ca6
+[mountd]
6014ca6
 # debug=0
6014ca6
 # manage_gids=n
6014ca6
 # descriptors=0
6014ca6
@@ -33,11 +34,11 @@
6014ca6
 # state-directory-path=/var/lib/nfs
6014ca6
 # ha-callout=
6014ca6
 #
6014ca6
-#[nfsdcltrack]
6014ca6
+[nfsdcltrack]
6014ca6
 # debug=0
6014ca6
 # storagedir=/var/lib/nfs/nfsdcltrack
6014ca6
 #
6014ca6
-#[nfsd]
6014ca6
+[nfsd]
6014ca6
 # debug=0
6014ca6
 # threads=8
6014ca6
 # host=
6014ca6
@@ -54,7 +55,7 @@
6014ca6
 # vers4.2=y
6014ca6
 # rdma=n
6014ca6
 #
6014ca6
-#[statd]
6014ca6
+[statd]
6014ca6
 # debug=0
6014ca6
 # port=0
6014ca6
 # outgoing-port=0
6014ca6
@@ -62,12 +63,12 @@
6014ca6
 # state-directory-path=/var/lib/nfs/statd
6014ca6
 # ha-callout=
6014ca6
 #
6014ca6
-#[sm-notify]
6014ca6
+[sm-notify]
6014ca6
 # debug=0
6014ca6
 # retry-time=900
6014ca6
 # outgoing-port=
6014ca6
 # outgoing-addr=
6014ca6
 # lift-grace=y
6014ca6
 #
6014ca6
-#[svcgssd]
6014ca6
+[svcgssd]
6014ca6
 # principal=
6014ca6
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
6014ca6
index 189b052..699db3f 100644
6014ca6
--- a/systemd/nfs.conf.man
6014ca6
+++ b/systemd/nfs.conf.man
6014ca6
@@ -213,6 +213,7 @@ for details.
6014ca6
 Recognized values:
6014ca6
 .BR use-memcache ,
6014ca6
 .BR use-machine-creds ,
6014ca6
+.BR use-gss-proxy ,
6014ca6
 .BR avoid-dns ,
6014ca6
 .BR limit-to-legacy-enctypes ,
6014ca6
 .BR context-timeout ,
6014ca6
diff --git a/utils/Makefile.am b/utils/Makefile.am
6014ca6
index d361aea..0a5b062 100644
6014ca6
--- a/utils/Makefile.am
6014ca6
+++ b/utils/Makefile.am
6014ca6
@@ -34,7 +34,6 @@ SUBDIRS = \
6014ca6
 	nfsstat \
6014ca6
 	showmount \
6014ca6
 	statd \
6014ca6
-	osd_login \
6014ca6
 	$(OPTDIRS)
6014ca6
 
6014ca6
 MAINTAINERCLEANFILES = Makefile.in
6014ca6
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
6014ca6
index 2c14e5f..2e92f28 100644
6014ca6
--- a/utils/gssd/gssd.c
6014ca6
+++ b/utils/gssd/gssd.c
6014ca6
@@ -89,6 +89,7 @@ char *preferred_realm = NULL;
6014ca6
 char *ccachedir = NULL;
6014ca6
 /* Avoid DNS reverse lookups on server names */
6014ca6
 static bool avoid_dns = true;
6014ca6
+static bool use_gssproxy = false;
6014ca6
 int thread_started = false;
6014ca6
 pthread_mutex_t pmutex = PTHREAD_MUTEX_INITIALIZER;
6014ca6
 pthread_cond_t pcond = PTHREAD_COND_INITIALIZER;
6014ca6
@@ -872,6 +873,7 @@ read_gss_conf(void)
6014ca6
 	if (s)
6014ca6
 		preferred_realm = s;
6014ca6
 
6014ca6
+	use_gssproxy = conf_get_bool("gssd", "use-gss-proxy", use_gssproxy);
6014ca6
 }
6014ca6
 
6014ca6
 int
6014ca6
@@ -888,6 +890,9 @@ main(int argc, char *argv[])
6014ca6
 
6014ca6
 	read_gss_conf();
6014ca6
 
6014ca6
+	verbosity = conf_get_num("gssd", "Verbosity", verbosity);
6014ca6
+	rpc_verbosity = conf_get_num("gssd", "RPC-Verbosity", rpc_verbosity);
6014ca6
+
6014ca6
 	while ((opt = getopt(argc, argv, "DfvrlmnMp:k:d:t:T:R:")) != -1) {
6014ca6
 		switch (opt) {
6014ca6
 			case 'f':
6014ca6
@@ -954,6 +959,14 @@ main(int argc, char *argv[])
6014ca6
 		exit(1);
6014ca6
 	}
6014ca6
 
6014ca6
+	if (use_gssproxy) {
6014ca6
+		if (setenv("GSS_USE_PROXY", "yes", 1) < 0) {
6014ca6
+			printerr(0, "gssd: Unable to set $GSS_USE_PROXY: %s\n", 
6014ca6
+				strerror(errno));
6014ca6
+			exit(EXIT_FAILURE);
6014ca6
+		}
6014ca6
+	}
6014ca6
+
6014ca6
 	if (ccachedir) {
6014ca6
 		char *ccachedir_copy;
6014ca6
 		char *ptr;
6014ca6
diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
6014ca6
index 8e918cc..ec49b61 100644
6014ca6
--- a/utils/gssd/svcgssd.c
6014ca6
+++ b/utils/gssd/svcgssd.c
6014ca6
@@ -113,6 +113,10 @@ main(int argc, char *argv[])
6014ca6
 	else
6014ca6
 		principal = s;
6014ca6
 
6014ca6
+	verbosity = conf_get_num("svcgssd", "Verbosity", verbosity);
6014ca6
+	rpc_verbosity = conf_get_num("svcgssd", "RPC-Verbosity", rpc_verbosity);
6014ca6
+	idmap_verbosity = conf_get_num("svcgssd", "IDMAP-Verbosity", idmap_verbosity);
6014ca6
+
6014ca6
 	while ((opt = getopt(argc, argv, "fivrnp:")) != -1) {
6014ca6
 		switch (opt) {
6014ca6
 			case 'f':
6014ca6
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
6014ca6
index 4811e0f..91c0253 100644
6014ca6
--- a/utils/idmapd/idmapd.c
6014ca6
+++ b/utils/idmapd/idmapd.c
6014ca6
@@ -36,7 +36,7 @@
6014ca6
 
6014ca6
 #include <sys/types.h>
6014ca6
 #include <sys/time.h>
6014ca6
-#include <sys/poll.h>
6014ca6
+#include <sys/inotify.h>
6014ca6
 #include <sys/socket.h>
6014ca6
 #include <sys/stat.h>
6014ca6
 #include <time.h>
6014ca6
@@ -205,15 +205,16 @@ static void usage(char *progname)
6014ca6
 int
6014ca6
 main(int argc, char **argv)
6014ca6
 {
6014ca6
-	int fd = 0, opt, fg = 0, nfsdret = -1;
6014ca6
+	int wd = -1, opt, fg = 0, nfsdret = -1;
6014ca6
 	struct idmap_clientq icq;
6014ca6
-	struct event rootdirev, clntdirev, svrdirev;
6014ca6
+	struct event rootdirev, clntdirev, svrdirev, inotifyev;
6014ca6
 	struct event initialize;
6014ca6
 	struct passwd *pw;
6014ca6
 	struct group *gr;
6014ca6
 	struct stat sb;
6014ca6
 	char *xpipefsdir = NULL;
6014ca6
 	int serverstart = 1, clientstart = 1;
6014ca6
+	int inotify_fd;
6014ca6
 	int ret;
6014ca6
 	char *progname;
6014ca6
 	char *conf_path = NULL;
6014ca6
@@ -261,6 +262,10 @@ main(int argc, char **argv)
6014ca6
 				strlcpy(pipefsdir, xpipefsdir, sizeof(pipefsdir));
6014ca6
 			CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User"));
6014ca6
 			CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group"));
6014ca6
+			if (conf_get_bool("General", "server-only", false))
6014ca6
+				clientstart = 0;
6014ca6
+			if (conf_get_bool("General", "client-only", false))
6014ca6
+				serverstart = 0;
6014ca6
 		}
6014ca6
 	} else {
6014ca6
 		conf_path = NFS_CONFFILE;
6014ca6
@@ -276,6 +281,10 @@ main(int argc, char **argv)
6014ca6
 				"cache-expiration", DEFAULT_IDMAP_CACHE_EXPIRY);
6014ca6
 		CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User"));
6014ca6
 		CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group"));
6014ca6
+		if (conf_get_bool("General", "server-only", false))
6014ca6
+			clientstart = 0;
6014ca6
+		if (conf_get_bool("General", "client-only", false))
6014ca6
+			serverstart = 0;
6014ca6
 	}
6014ca6
 
6014ca6
 	while ((opt = getopt(argc, argv, GETOPTSTR)) != -1)
6014ca6
@@ -373,18 +382,15 @@ main(int argc, char **argv)
6014ca6
 			}
6014ca6
 		}
6014ca6
 
6014ca6
-		if ((fd = open(pipefsdir, O_RDONLY)) == -1)
6014ca6
-			xlog_err("main: open(%s): %s", pipefsdir, strerror(errno));
6014ca6
-
6014ca6
-		if (fcntl(fd, F_SETSIG, SIGUSR1) == -1)
6014ca6
-			xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
6014ca6
-
6014ca6
-		if (fcntl(fd, F_NOTIFY,
6014ca6
-			DN_CREATE | DN_DELETE | DN_MODIFY | DN_MULTISHOT) == -1) {
6014ca6
-			xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
6014ca6
-			if (errno == EINVAL)
6014ca6
-				xlog_err("main: Possibly no Dnotify support in kernel.");
6014ca6
+		inotify_fd = inotify_init1(IN_NONBLOCK);
6014ca6
+		if (inotify_fd == -1) {
6014ca6
+			xlog_err("Unable to initialise inotify_init1: %s\n", strerror(errno));
6014ca6
+		} else {
6014ca6
+			wd = inotify_add_watch(inotify_fd, pipefsdir, IN_CREATE | IN_DELETE | IN_MODIFY);
6014ca6
+			if (wd < 0)
6014ca6
+				xlog_err("Unable to inotify_add_watch(%s): %s\n", pipefsdir, strerror(errno));
6014ca6
 		}
6014ca6
+
6014ca6
 		TAILQ_INIT(&icq;;
6014ca6
 
6014ca6
 		/* These events are persistent */
6014ca6
@@ -394,6 +400,10 @@ main(int argc, char **argv)
6014ca6
 		signal_add(&clntdirev, NULL);
6014ca6
 		signal_set(&svrdirev, SIGHUP, svrreopen, NULL);
6014ca6
 		signal_add(&svrdirev, NULL);
6014ca6
+		if ( wd >= 0) {
6014ca6
+			event_set(&inotifyev, inotify_fd, EV_READ, dirscancb, &icq;;
6014ca6
+			event_add(&inotifyev, NULL);
6014ca6
+		}
6014ca6
 
6014ca6
 		/* Fetch current state */
6014ca6
 		/* (Delay till start of event_dispatch to avoid possibly losing
6014ca6
@@ -402,7 +412,7 @@ main(int argc, char **argv)
6014ca6
 		evtimer_add(&initialize, &now;;
6014ca6
 	}
6014ca6
 
6014ca6
-	if (nfsdret != 0 && fd == 0)
6014ca6
+	if (nfsdret != 0 && wd < 0)
6014ca6
 		xlog_err("main: Neither NFS client nor NFSd found");
6014ca6
 
6014ca6
 	daemon_ready();
6014ca6
diff --git a/utils/mount/Makefile.am b/utils/mount/Makefile.am
6014ca6
index 7b97c31..ad0be93 100644
6014ca6
--- a/utils/mount/Makefile.am
6014ca6
+++ b/utils/mount/Makefile.am
6014ca6
@@ -27,6 +27,7 @@ endif
6014ca6
 
6014ca6
 mount_nfs_LDADD = ../../support/nfs/libnfs.la \
6014ca6
 		  ../../support/export/libexport.a \
6014ca6
+		  ../../support/misc/libmisc.a \
6014ca6
 		  $(LIBTIRPC)
6014ca6
 
6014ca6
 mount_nfs_SOURCES = $(mount_common)
6014ca6
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
6014ca6
index 4d2e37e..0a25b1f 100644
6014ca6
--- a/utils/mount/stropts.c
6014ca6
+++ b/utils/mount/stropts.c
6014ca6
@@ -48,6 +48,7 @@
6014ca6
 #include "version.h"
6014ca6
 #include "parse_dev.h"
6014ca6
 #include "conffile.h"
6014ca6
+#include "misc.h"
6014ca6
 
6014ca6
 #ifndef NFS_PROGRAM
6014ca6
 #define NFS_PROGRAM	(100003)
6014ca6
@@ -1078,14 +1079,18 @@ static int nfsmount_fg(struct nfsmount_info *mi)
6014ca6
 		if (nfs_try_mount(mi))
6014ca6
 			return EX_SUCCESS;
6014ca6
 
6014ca6
-		if (errno == EBUSY)
6014ca6
-			/* The only cause of EBUSY is if exactly the desired
6014ca6
-			 * filesystem is already mounted.  That can arguably
6014ca6
-			 * be seen as success.  "mount -a" tries to optimise
6014ca6
-			 * out this case but sometimes fails.  Help it out
6014ca6
-			 * by pretending everything is rosy
6014ca6
+#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
6014ca6
+		if (errno == EBUSY && is_mountpoint(mi->node)) {
6014ca6
+#pragma GCC diagnostic warning "-Wdiscarded-qualifiers"
6014ca6
+			/*
6014ca6
+			 * EBUSY can happen when mounting a filesystem that
6014ca6
+			 * is already mounted or when the context= are
6014ca6
+			 * different when using the -o sharecache
6014ca6
+			 *
6014ca6
+			 * Only error out in the latter case.
6014ca6
 			 */
6014ca6
 			return EX_SUCCESS;
6014ca6
+		}
6014ca6
 
6014ca6
 		if (nfs_is_permanent_error(errno))
6014ca6
 			break;
6014ca6
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
6014ca6
index 6b57e2b..b256bd9 100644
6014ca6
--- a/utils/nfsd/nfsd.c
6014ca6
+++ b/utils/nfsd/nfsd.c
6014ca6
@@ -83,6 +83,9 @@ main(int argc, char **argv)
6014ca6
 
6014ca6
 	conf_init_file(NFS_CONFFILE); 
6014ca6
 	xlog_from_conffile("nfsd");
6014ca6
+
6014ca6
+	nfssvc_get_minormask(&minormask);
6014ca6
+
6014ca6
 	count = conf_get_num("nfsd", "threads", count);
6014ca6
 	grace = conf_get_num("nfsd", "grace-time", grace);
6014ca6
 	lease = conf_get_num("nfsd", "lease-time", lease);
6014ca6
@@ -101,13 +104,19 @@ main(int argc, char **argv)
6014ca6
 	for (i = 2; i <= 4; i++) {
6014ca6
 		char tag[20];
6014ca6
 		sprintf(tag, "vers%d", i);
6014ca6
-		if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i)))
6014ca6
+		if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) {
6014ca6
 			NFSCTL_VERSET(versbits, i);
6014ca6
-		else
6014ca6
+			if (i == 4)
6014ca6
+				minorvers = minorversset = minormask;
6014ca6
+		} else {
6014ca6
 			NFSCTL_VERUNSET(versbits, i);
6014ca6
+			if (i == 4) {
6014ca6
+				minorvers = 0;
6014ca6
+				minorversset = minormask;
6014ca6
+			}
6014ca6
+		}
6014ca6
 	}
6014ca6
 
6014ca6
-	nfssvc_get_minormask(&minormask);
6014ca6
 	/* We assume the kernel will default all minor versions to 'on',
6014ca6
 	 * and allow the config file to disable some.
6014ca6
 	 */
6014ca6
diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
6014ca6
deleted file mode 100644
6014ca6
index ded1fd3..0000000
6014ca6
--- a/utils/osd_login/Makefile.am
6014ca6
+++ /dev/null
6014ca6
@@ -1,9 +0,0 @@
6014ca6
-## Process this file with automake to produce Makefile.in
6014ca6
-
6014ca6
-# These binaries go in /sbin (not /usr/sbin), and that cannot be
6014ca6
-# overridden at config time.
6014ca6
-sbindir = /sbin
6014ca6
-
6014ca6
-dist_sbin_SCRIPTS = osd_login
6014ca6
-
6014ca6
-MAINTAINERCLEANFILES = Makefile.in
6014ca6
diff --git a/utils/osd_login/osd_login b/utils/osd_login/osd_login
6014ca6
deleted file mode 100644
6014ca6
index 08cd2d2..0000000
6014ca6
--- a/utils/osd_login/osd_login
6014ca6
+++ /dev/null
6014ca6
@@ -1,118 +0,0 @@
6014ca6
-#!/bin/bash
6014ca6
-#
6014ca6
-# osd_login : This script is part of the autologin feature
6014ca6
-#             mandated by the pnfs-objects standard.
6014ca6
-# It is called from objlayoutdriver.ko in the kernel.
6014ca6
-
6014ca6
-# Copyright (C) 2012, Sachin Bhamare <sbhamare@panasas.com>
6014ca6
-# Copyright (C) 2012, Boaz Harrosh <bharrosh@panasas.com>
6014ca6
-#
6014ca6
-# This program is free software; you can redistribute it and/or modify
6014ca6
-# it under the terms of the GNU General Public License version 2 as
6014ca6
-# published by the Free Software Foundation.
6014ca6
-#
6014ca6
-# This program is distributed in the hope that it will be useful,
6014ca6
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
6014ca6
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6014ca6
-# GNU General Public License for more details.
6014ca6
-#
6014ca6
-# You should have received a copy of the GNU General Public License
6014ca6
-# along with this program; if not, write to the Free Software
6014ca6
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
6014ca6
-# MA 02110-1301 USA
6014ca6
-
6014ca6
-umask 022
6014ca6
-
6014ca6
-PATH="/sbin:/usr/sbin:/bin:/usr/bin"
6014ca6
-
6014ca6
-iscsiadm=/sbin/iscsiadm
6014ca6
-
6014ca6
-PARENT_PID=$BASHPID
6014ca6
-WATCHDOG_TIMEOUT=15
6014ca6
-
6014ca6
-protocol=""
6014ca6
-portal=""
6014ca6
-uri=""
6014ca6
-osdname=""
6014ca6
-systemid=""
6014ca6
-
6014ca6
-usage()
6014ca6
-{
6014ca6
-	echo "Usage: $0 -u <URI> -o <OSDNAME> -s <SYSTEMID>"
6014ca6
-	echo "Options:"
6014ca6
-	echo  "-u		target uri e.g. iscsi://<ip>:<port>"
6014ca6
-	echo  "-o		osdname of the target OSD"
6014ca6
-	echo  "-s		systemid of the target OSD"
6014ca6
-}
6014ca6
-
6014ca6
-parse_cmdline()
6014ca6
-{
6014ca6
-	argc=$#
6014ca6
-	if [ $# -lt 3 ]; then
6014ca6
-		usage
6014ca6
-		exit 1
6014ca6
-	fi
6014ca6
-
6014ca6
-	# parse the input arguments
6014ca6
-	while getopts "u:o:s:" options; do
6014ca6
-	    case $options in
6014ca6
-		u ) uri=$OPTARG;;
6014ca6
-		o ) osdname=$OPTARG;;
6014ca6
-		s ) systemid=$OPTARG;;
6014ca6
-		\? ) usage
6014ca6
-			exit 1;;
6014ca6
-		* )  usage
6014ca6
-			exit 1;;
6014ca6
-	    esac
6014ca6
-	done
6014ca6
-
6014ca6
-	echo "-u : $uri"
6014ca6
-	echo "-o : $osdname"
6014ca6
-	echo "-s : $systemid"
6014ca6
-
6014ca6
-	protocol=`echo $uri | awk -F ':' '{print $1}'`
6014ca6
-	portal=`echo $uri | awk -F '//' '{print $2}'`
6014ca6
-}
6014ca6
-
6014ca6
-watchdog()
6014ca6
-{
6014ca6
-	timeout=$1
6014ca6
-	portal=$2
6014ca6
-
6014ca6
-	sleep $timeout
6014ca6
-	if kill -9 $PARENT_PID; then
6014ca6
-	    echo "watchdog : Timed out (>$timeout seconds) while login into $portal" | logger -t "osd_login"
6014ca6
-	fi
6014ca6
-	echo "watchdog: exiting .."
6014ca6
-	exit 2
6014ca6
-}
6014ca6
-
6014ca6
-login_iscsi_osd()
6014ca6
-{
6014ca6
-	echo "login into: $1"
6014ca6
-	if ! $iscsiadm -m discovery -o nonpersistent -t sendtargets -p $1 --login; then
6014ca6
-		echo "$iscsiadm -m discovery -t sendtargets -p $1 --login returned error $? !"
6014ca6
-		sleep 1;
6014ca6
-	fi
6014ca6
-}
6014ca6
-
6014ca6
-echo "============= osd_login ========="
6014ca6
-echo "progname : $0"
6014ca6
-parse_cmdline "$@"
6014ca6
-echo "protocol: $protocol"
6014ca6
-echo "portal: $portal"
6014ca6
-
6014ca6
-watchdog $WATCHDOG_TIMEOUT $portal &
6014ca6
-watchdog_pid=$!
6014ca6
-
6014ca6
-case $protocol in
6014ca6
-iscsi)
6014ca6
-	login_iscsi_osd $portal |& logger -t "osd_login"
6014ca6
-	;;
6014ca6
-*)
6014ca6
-	echo "Error: protocol $protocol not supported !" | logger -t "osd_login"
6014ca6
-	;;
6014ca6
-esac
6014ca6
-
6014ca6
-kill -9 $watchdog_pid
6014ca6
-exit 0
6014ca6
diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c
6014ca6
index 7a48473..29dad38 100644
6014ca6
--- a/utils/statd/sm-notify.c
6014ca6
+++ b/utils/statd/sm-notify.c
6014ca6
@@ -503,6 +503,7 @@ main(int argc, char **argv)
6014ca6
 	s = conf_get_str("statd", "state-directory-path");
6014ca6
 	if (s && !nsm_setup_pathnames(argv[0], s))
6014ca6
 		exit(1);
6014ca6
+	opt_update_state = conf_get_bool("sm-notify", "update-state", opt_update_state);
6014ca6
 
6014ca6
 	while ((c = getopt(argc, argv, "dm:np:v:P:f")) != -1) {
6014ca6
 		switch (c) {