From mboxrd@z Thu Jan 1 00:00:00 1970 From: teigland@sourceware.org Date: 6 Jun 2007 15:51:12 -0000 Subject: [Cluster-devel] cluster/gfs2/mount util.c Message-ID: <20070606155112.31051.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL5 Changes by: teigland at sourceware.org 2007-06-06 15:51:11 Modified files: gfs2/mount : util.c Log message: translate different error numbers from gfs_controld into specific, helpful error messages Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/util.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.5&r2=1.18.2.6 --- cluster/gfs2/mount/util.c 2007/05/24 19:00:02 1.18.2.5 +++ cluster/gfs2/mount/util.c 2007/06/06 15:51:11 1.18.2.6 @@ -437,7 +437,7 @@ rv = snprintf(buf, MAXLINE, "join %s %s %s %s %s %s", dir, fsname, proto, table, options, mo->dev); if (rv >= MAXLINE) { - warn("lock_dlm_join: message too long: %d \"%s\"", rv, buf); + warn("gfs_controld message too long: %d \"%s\"", rv, buf); rv = -1; goto out; } @@ -447,7 +447,7 @@ rv = write(fd, buf, sizeof(buf)); if (rv < 0) { - warn("lock_dlm_join: gfs_controld write error: %d", rv); + warn("gfs_controld write error: %d", rv); goto out; } @@ -463,23 +463,73 @@ memset(buf, 0, sizeof(buf)); rv = read(fd, buf, sizeof(buf)); if (rv < 0) { - warn("lock_dlm_join: gfs_controld read 1 error: %d", rv); + warn("error reading result from gfs_controld: %d", rv); goto out; } rv = atoi(buf); - if (rv == -EALREADY) { + switch (rv) { + case 0: + break; + + case -EEXIST: + warn("mount group already exists. " + "Duplicate locktable name %s, or %s already mounted", + table, mo->dev); + goto out; + + case -EPROTONOSUPPORT: + warn("lockproto not supported"); + goto out; + + case -EOPNOTSUPP: + warn("jid, first and id are reserved options"); + goto out; + + case -EBADFD: + warn("no colon found in table name"); + goto out; + + case -ENAMETOOLONG: + warn("fs name too long"); + goto out; + + case -EADDRINUSE: + warn("different fs appears to exist with the same name"); + goto out; + + case -EBUSY: + warn("mount point already used or other mount in progress"); + goto out; + + case -EALREADY: log_debug("fs already mounted, adding mountpoint"); adding_another_mountpoint = 1; rv = 0; goto out; - } - if (rv < 0) { - warn("lock_dlm_join: gfs_controld join error: %d", rv); - if (rv == -EEXIST) - warn("lock_dlm_join: mountgroup already exists. " - "Duplicate locktable name %s, or %s already " - "mounted\n", table, mo->dev); + + case -ENOMEM: + warn("out of memory"); + goto out; + + case -EBADR: + warn("fs is for a different cluster"); + goto out; + + case -ENOANO: + warn("node not a member of the default fence domain"); + goto out; + + case -EROFS: + warn("read-only mount invalid with spectator option"); + goto out; + + case -EMLINK: + warn("option string too long"); + goto out; + + default: + warn("gfs_controld join error: %d", rv); goto out; }