All of lore.kernel.org
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/gfs_controld recover.c
Date: 6 Jun 2007 15:44:49 -0000	[thread overview]
Message-ID: <20070606154449.28204.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2007-06-06 15:44:49

Modified files:
	group/gfs_controld: recover.c 

Log message:
	return a different error number to mount.gfs for each specific failure
	case, so mount can translate that into a helpful error message

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&r1=1.29&r2=1.30

--- cluster/group/gfs_controld/recover.c	2007/04/26 19:01:34	1.29
+++ cluster/group/gfs_controld/recover.c	2007/06/06 15:44:49	1.30
@@ -1537,7 +1537,7 @@
 
 	if (strcmp(mg->dev, dev)) {
 		log_error("different fs dev %s with same name", mg->dev);
-		return -EINVAL;
+		return -EADDRINUSE;
 	}
 
 	if (find_mountpoint(mg, dir)) {
@@ -1575,14 +1575,14 @@
 	struct mountgroup *mg = NULL;
 	char table2[MAXLINE];
 	char *cluster = NULL, *name = NULL;
-	int rv;
+	int rv, new_mg = 0;
 
 	log_debug("mount: %s %s %s %s %s %s",
 		  dir, type, proto, table, options, dev);
 
 	if (strcmp(proto, "lock_dlm")) {
 		log_error("mount: lockproto %s not supported", proto);
-		rv = -EINVAL;
+		rv = -EPROTONOSUPPORT;
 		goto out;
 	}
 
@@ -1590,7 +1590,7 @@
 	    strstr(options, "first=") ||
 	    strstr(options, "id=")) {
 		log_error("mount: jid, first and id are reserved options");
-		rv = -EINVAL;
+		rv = -EOPNOTSUPP;
 		goto out;
 	}
 
@@ -1601,7 +1601,7 @@
 
 	name = strstr(table2, ":");
 	if (!name) {
-		rv = -EINVAL;
+		rv = -EBADFD;
 		goto out;
 	}
 
@@ -1625,6 +1625,7 @@
 		rv = -ENOMEM;
 		goto out;
 	}
+	new_mg = 1;
 
 	mg->mount_client = ci;
 	strncpy(mg->type, type, sizeof(mg->type));
@@ -1634,7 +1635,7 @@
 
 	if (strlen(cluster) != strlen(clustername) ||
 	    strlen(cluster) == 0 || strcmp(cluster, clustername)) {
-		rv = -1;
+		rv = -EBADR;
 		log_error("mount: fs requires cluster=\"%s\" current=\"%s\"",
 			  cluster, clustername);
 		goto out;
@@ -1646,7 +1647,7 @@
 		mg->spectator = 1;
 	} else {
 		if (!we_are_in_fence_domain()) {
-			rv = -EINVAL;
+			rv = -ENOANO;
 			log_error("mount: not in default fence domain");
 			goto out;
 		}
@@ -1656,7 +1657,7 @@
 		mg->rw = 1;
 	else if (strstr(options, "ro")) {
 		if (mg->spectator) {
-			rv = -EINVAL;
+			rv = -EROFS;
 			log_error("mount: readonly invalid with spectator");
 			goto out;
 		}
@@ -1664,7 +1665,7 @@
 	}
 
 	if (strlen(options) > MAX_OPTIONS_LEN-1) {
-		rv = -EINVAL;
+		rv = -EMLINK;
 		log_error("mount: options too long %d", strlen(options));
 		goto out;
 	}
@@ -1673,8 +1674,12 @@
 	group_join(gh, name);
 	rv = 0;
  out:
-	*mg_ret = mg;
-	log_group(mg, "do_mount: rv %d", rv);
+	if (mg) {
+		*mg_ret = mg;
+		log_group(mg, "do_mount: rv %d", rv);
+	}
+	if (rv && new_mg)
+		free(mg);
 	return rv;
 }
 



             reply	other threads:[~2007-06-06 15:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 15:44 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-06 15:47 [Cluster-devel] cluster/group/gfs_controld recover.c teigland
2006-12-19 22:20 teigland
2006-12-19 22:19 teigland
2006-12-19 22:19 teigland
2006-10-16 15:09 teigland
2006-08-31 18:56 teigland
2006-08-21 19:38 teigland
2006-08-15 21:38 teigland
2006-08-10 19:40 teigland

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=20070606154449.28204.qmail@sourceware.org \
    --to=teigland@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.