All of lore.kernel.org
 help / color / mirror / Atom feed
From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/rgmanager ChangeLog src/daemons/fo_dom ...
Date: 16 Jun 2006 19:57:53 -0000	[thread overview]
Message-ID: <20060616195753.26478.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	lhh at sourceware.org	2006-06-16 19:57:52

Modified files:
	rgmanager      : ChangeLog 
	rgmanager/src/daemons: fo_domain.c groups.c rg_state.c 
	rgmanager/src/resources: clusterfs.sh fs.sh nfsclient.sh 
	                         nfsexport.sh svclib_nfslock 

Log message:
	Work around #193128, clean up NFS bits

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.17&r2=1.5.2.18
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/fo_domain.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.3&r2=1.5.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/groups.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.8.2.16&r2=1.8.2.17
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_state.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.13&r2=1.4.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/clusterfs.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.8&r2=1.1.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/fs.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.13&r2=1.4.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/nfsclient.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.7&r2=1.3.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/nfsexport.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.4&r2=1.4.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/svclib_nfslock.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.1&r2=1.1.2.2

--- cluster/rgmanager/ChangeLog	2006/05/26 17:39:32	1.5.2.17
+++ cluster/rgmanager/ChangeLog	2006/06/16 19:57:52	1.5.2.18
@@ -1,3 +1,10 @@
+2006-06-16 Lon Hohberger <lhh@redhat.com>
+	* src/daemons/fo_domain.c, groups.c: Get rid of compiler warnings
+	* src/daemons/rg_state.c: Change clu_lock_verbose to use the NULL
+	lock/convert mechanism offered by DLM to work around #193128
+	* src/resources/fs.sh, clusterfs.sh, nfsexport.sh, nfsclient.sh,
+	service.sh, svclib_nfslock: Finish up initial NFS workaround.
+
 2006-05-23 Lon Hohberger <lhh@redhat.com>
 	* src/daemons/members.c: Zap pad fields on copy-out
 	* src/daemons/main.c: Give notice if skipping an event because of
--- cluster/rgmanager/src/daemons/fo_domain.c	2006/05/12 21:28:31	1.5.2.3
+++ cluster/rgmanager/src/daemons/fo_domain.c	2006/06/16 19:57:52	1.5.2.4
@@ -332,8 +332,10 @@
 	fod_t *fod = NULL;
 	int found = 0;
 	int owned_by_node = 0, started = 0, no_owner = 0;
+#ifndef NO_CCS
 	rg_state_t svc_state;
 	void *lockp;
+#endif
 
 	ENTER();
 
--- cluster/rgmanager/src/daemons/groups.c	2006/06/12 18:40:11	1.8.2.16
+++ cluster/rgmanager/src/daemons/groups.c	2006/06/16 19:57:52	1.8.2.17
@@ -757,7 +757,6 @@
 	resource_node_t *curr;
 	char *name;
 	rg_state_t svcblk;
-	void *lockp;
 
 	pthread_rwlock_rdlock(&resource_lock);
 	list_do(&_tree, curr) {
@@ -814,7 +813,6 @@
 	char *name;
 	rg_state_t svcblk;
 	int need_kill;
-	void *lockp;
 
 	clulog(LOG_INFO, "Stopping changed resources.\n");
 
--- cluster/rgmanager/src/daemons/rg_state.c	2006/05/26 15:32:00	1.4.2.13
+++ cluster/rgmanager/src/daemons/rg_state.c	2006/06/16 19:57:52	1.4.2.14
@@ -117,6 +117,7 @@
 	struct timeval start, now;
 	uint64_t nodeid, *p;
 	int flags;
+	int conv = 0, err;
 	int block = !(dflt_flags & CLK_NOWAIT);
 
 	/* Holder not supported for this call */
@@ -128,6 +129,37 @@
 		gettimeofday(&start, NULL);
 		start.tv_sec += 30;
 	}
+
+	/* Ripped from global.c in magma */
+	if (!(dflt_flags & CLK_CONVERT) &&
+	    (block || ((dflt_flags & CLK_EX) == 0))) {
+		/* Acquire NULL lock */
+		ret = clu_lock(resource, CLK_NULL, lockpp);
+		err = errno;
+		if (ret == 0) {
+			if ((flags & CLK_EX) == 0) {
+				/* User only wanted a NULL lock... */
+				return 0;
+			}
+			/*
+			   Ok, NULL lock was taken, rest of blocking
+			   call should be done using lock conversions.
+			 */
+			flags |= CLK_CONVERT;
+			conv = 1;
+		} else {
+			switch(err) {
+			case EINVAL:
+				/* Oops, null locks don't work on this
+				   plugin; use normal spam mode */
+				break;
+			default:
+				errno = err;
+				return -1;
+			}
+		}
+	}
+
 	while (1) {
 		if (block) {
 			gettimeofday(&now, NULL);
@@ -145,9 +177,14 @@
 		}
 
 		*lockpp = NULL;
-		ret = clu_lock(resource, flags | CLK_NOWAIT, lockpp);
 
-		if ((ret != 0) && (errno == EAGAIN) && block) {
+		/* Take the lock (convert if possible). */
+		ret = clu_lock(resource, flags | CLK_NOWAIT |
+			       ((conv && !timed_out) ? CLK_CONVERT : 0),
+			       lockpp);
+		err = errno;
+
+		if ((ret != 0) && (err == EAGAIN) && block) {
 			if (timed_out) {
 				p = (uint64_t *)*lockpp;
 				if (p) {
@@ -176,6 +213,16 @@
 		break;
 	}
 
+	/* Fatal error.  If we took an automatic NL lock with the hopes of
+	   converting it, release the lock before returning */
+	if (conv == 1 && ret < 0) {
+		clu_unlock(resource, *lockpp);
+		*lockpp = NULL;
+	}
+
+	if (ret < 0)
+		errno = err;
+
 	return ret;
 }
 
--- cluster/rgmanager/src/resources/clusterfs.sh	2006/05/16 20:03:04	1.1.2.8
+++ cluster/rgmanager/src/resources/clusterfs.sh	2006/06/16 19:57:52	1.1.2.9
@@ -803,10 +803,10 @@
 		ocf_log warning "Dropping node-wide NFS locks"
 		mkdir -p $mp/.clumanager/statd
 		# Copy out the notify list; our 
-		# IPs are already torn down
-		if notify_list_store $mp/.clumanager/statd; then
-			notify_list_broadcast $mp/.clumanager/statd
-		fi
+			# IPs are already torn down
+			if notify_list_store $mp/.clumanager/statd; then
+				notify_list_broadcast $mp/.clumanager/statd
+			fi
 	fi
 
 	# Always invalidate buffers on clusterfs resources
--- cluster/rgmanager/src/resources/fs.sh	2006/05/16 20:03:04	1.4.2.13
+++ cluster/rgmanager/src/resources/fs.sh	2006/06/16 19:57:52	1.4.2.14
@@ -1153,6 +1153,7 @@
 				     [ "$OCF_RESKEY_nfslock" = "1" ]; then
 				    ocf_log warning \
 					"Dropping node-wide NFS locks"
+				    pkill -KILL -x lockd
 	          		    mkdir -p $mp/.clumanager/statd
 				    # Copy out the notify list; our 
 				    # IPs are already torn down
--- cluster/rgmanager/src/resources/nfsclient.sh	2006/05/16 20:03:04	1.3.2.7
+++ cluster/rgmanager/src/resources/nfsclient.sh	2006/06/16 19:57:52	1.3.2.8
@@ -95,6 +95,18 @@
             <content type="string"/>
         </parameter>
 
+        <parameter name="nfslock" inherit="nfsexport%nfslock">
+            <longdesc lang="en">
+	    	This tells us whether the service in question has the
+		NFS lock workarounds enabled.  If so, we always unexport
+		* rather than the specified client.
+            </longdesc>
+            <shortdesc lang="en">
+	    	NFS Lock workaround flag
+            </shortdesc>
+            <content type="boolean"/>
+        </parameter>
+
         <parameter name="options">
             <longdesc lang="en">Defines a list of options for this
                 particular client.  See 'man 5 exports' for a list
@@ -295,6 +307,14 @@
 stop)
 	verify_all || exit $OCF_ERR_ARGS
 
+	if [ "$OCF_RESKEY_nfslock" = "1" ]; then
+		#
+		# If the NFS lock workarounds were enabled, unexport from
+		# the world
+		#
+		export OCF_RESKEY_target="*"
+	fi
+
 	ocf_log info "Removing export: ${OCF_RESKEY_target}:${OCF_RESKEY_path}"
 	exportfs -u "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
 	rv=$?
--- cluster/rgmanager/src/resources/nfsexport.sh	2005/12/07 22:53:31	1.4.2.4
+++ cluster/rgmanager/src/resources/nfsexport.sh	2006/06/16 19:57:52	1.4.2.5
@@ -97,6 +97,19 @@
             </shortdesc>
 	    <content type="string"/>
         </parameter>
+
+        <parameter name="nfslock" inherit="nfslock">
+            <longdesc lang="en">
+                If you can see this, your GUI is broken.
+		This inherits an unspecified nfslock parameter so that
+		it works with fs or clusterfs resources.
+            </longdesc>
+            <shortdesc lang="en">
+                If you can see this, your GUI is broken.
+            </shortdesc>
+	    <content type="boolean"/>
+        </parameter>
+
     </parameters>
 
     <actions>
--- cluster/rgmanager/src/resources/svclib_nfslock	2006/05/16 20:03:04	1.1.2.1
+++ cluster/rgmanager/src/resources/svclib_nfslock	2006/06/16 19:57:52	1.1.2.2
@@ -163,17 +163,6 @@
 	declare lockd_pid=$(pidof lockd)
 	declare nl_dir=$1
 
-	# First of all, send lockd a SIGKILL.  We hope nfsd is running.
-	# If it is, this will cause lockd to reset the grace period for
-	# lock reclaiming.
-	if [ -n "$lockd_pid" ]; then
-		ocf_log info "Asking lockd to drop locks (pid $lockd_pid)"
-		kill -9 $lockd_pid
-	else
-		ocf_log warning "lockd not running; cannot notify clients"
-		return 1
-	fi
-	
         while read dev family addr maskbits; do
 		if [ "$family" != "inet" ]; then
 			continue



                 reply	other threads:[~2006-06-16 19:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060616195753.26478.qmail@sourceware.org \
    --to=lhh@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.