master - mount.gfs: fix mount error handling

David Teigland teigland@fedoraproject.org
Mon Sep 8 21:42:00 GMT 2008


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f9111c411ad562d02df688cc64689462f43c8e0b
Commit:        f9111c411ad562d02df688cc64689462f43c8e0b
Parent:        5fd95228e8b58a6b42f78a01a480e686e53086c3
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Mon Sep 8 14:40:04 2008 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Mon Sep 8 14:40:04 2008 -0500

mount.gfs: fix mount error handling

When mount(2) fails, mount.gfs tells gfs_controld to leave the cpg.
libgfscontrol requires the leave call to specify the locktable, which
mount.gfs wasn't setting, causing it to segfault.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 gfs2/mount/util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c
index fecacea..48b0b39 100644
--- a/gfs2/mount/util.c
+++ b/gfs2/mount/util.c
@@ -494,6 +494,10 @@ int lock_dlm_leave(struct mount_options *mo, struct gen_sb *sb, int mnterr)
 
 	strncpy(ma.dir, mo->dir, PATH_MAX);
 	strncpy(ma.type, fsname, PATH_MAX);
+	if (mo->locktable[0])
+		strncpy(ma.table, mo->locktable, PATH_MAX);
+	else
+		strncpy(ma.table, sb->locktable, PATH_MAX);
 
 	rv = gfsc_fs_leave(&ma, mnterr);
 	if (rv)



More information about the Cluster-cvs mailing list