This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE2 - gfs_controld: read lockless resources from ckpts


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d09d455d3bf5fa93eed53506856c47b30d27f775
Commit:        d09d455d3bf5fa93eed53506856c47b30d27f775
Parent:        274d571028a4b50f04e5ce56f76bac1898f7e77c
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Dec 12 11:24:48 2008 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Dec 12 11:34:49 2008 -0600

gfs_controld: read lockless resources from ckpts

bz 474163

When we mount and read plock state from a checkpoint, we can't
ignore zero-size checkpoint sections, because we need to add
the resource along with its owner from the section id.  What
should be skipped are zero-length section id's.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/gfs_controld/plock.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c
index e7c9fe0..b90417a 100644
--- a/group/gfs_controld/plock.c
+++ b/group/gfs_controld/plock.c
@@ -2223,7 +2223,7 @@ void retrieve_plocks(struct mountgroup *mg)
 			goto out_it;
 		}
 
-		if (!desc.sectionSize)
+		if (!desc.sectionId.idLen)
 			continue;
 
 		iov.sectionId = desc.sectionId;
@@ -2231,8 +2231,10 @@ void retrieve_plocks(struct mountgroup *mg)
 		iov.dataSize = desc.sectionSize;
 		iov.dataOffset = 0;
 
+		/* for debug print */
 		memset(&buf, 0, sizeof(buf));
 		snprintf(buf, SECTION_NAME_LEN, "%s", desc.sectionId.id);
+
 		log_group(mg, "retrieve_plocks: section size %llu id %u \"%s\"",
 			  (unsigned long long)iov.dataSize, iov.sectionId.idLen,
 			  buf);
@@ -2250,13 +2252,14 @@ void retrieve_plocks(struct mountgroup *mg)
 			goto out_it;
 		}
 
+		/* we'll get empty (zero length) sections for resources with
+		   no locks, which exist in ownership mode; the resource
+		   name and owner come from the section id */
+
 		log_group(mg, "retrieve_plocks: ckpt read %llu bytes",
 			  (unsigned long long)iov.readSize);
 		section_len = iov.readSize;
 
-		if (!section_len)
-		       continue;
-
 		if (section_len % sizeof(struct pack_plock)) {
 			log_error("retrieve_plocks: bad section len %d %s",
 				  section_len, mg->name);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]