summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-11-25 04:11:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-25 06:35:26 -0800
commit6623055696e1b28267305ac45087497f4c6a884a (patch)
tree83136152f1d77a062f30322b5feda4bf857e32a8 /xlators/nfs/server/src/mount3.c
parent26a8202550593232f941cd2251cfbeb304991808 (diff)
nfs: Export subvolumes on per-subvolume CHILD-UP
..so that nfs clients can mount an UP subvolume even if other subvolumes havent come up yet. This was a problem because nfs was waiting for all children to receive CHILD-UP before exporting any subvolume. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2093 (volumes cannot start when one node in a replicated setup is down) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2093
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
-rw-r--r--xlators/nfs/server/src/mount3.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 2e4a7390849..25754a30f12 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -37,6 +37,7 @@
#include "locking.h"
#include "iatt.h"
#include "nfs-mem-types.h"
+#include "nfs.h"
#include <errno.h>
@@ -736,6 +737,7 @@ mnt3svc_mnt (rpcsvc_request_t *req)
struct mount3_state *ms = NULL;
mountstat3 mntstat = MNT3ERR_SERVERFAULT;
struct mnt3_export *exp = NULL;
+ struct nfs_state *nfs = NULL;
if (!req)
return -1;
@@ -766,6 +768,15 @@ mnt3svc_mnt (rpcsvc_request_t *req)
goto mnterr;
}
+ nfs = (struct nfs_state *)ms->nfsx->private;
+ if (!nfs_subvolume_started (nfs, exp->vol)) {
+ gf_log (GF_MNT, GF_LOG_DEBUG, "Volume %s not started",
+ exp->vol->name);
+ ret = -1;
+ mntstat = MNT3ERR_NOENT;
+ goto mnterr;
+ }
+
ret = mnt3_check_client_net (ms, req, exp->vol);
if (ret == RPCSVC_AUTH_REJECT) {
mntstat = MNT3ERR_ACCES;
@@ -1150,11 +1161,20 @@ mnt3_xlchildren_to_exports (rpcsvc_t *svc, struct mount3_state *ms)
int ret = -1;
char *addrstr = NULL;
struct mnt3_export *ent = NULL;
+ struct nfs_state *nfs = NULL;
if ((!ms) || (!svc))
return NULL;
+ nfs = (struct nfs_state *)ms->nfsx->private;
list_for_each_entry(ent, &ms->exportlist, explist) {
+
+ /* If volume is not started yet, do not list it for tools like
+ * showmount.
+ */
+ if (!nfs_subvolume_started (nfs, ent->vol))
+ continue;
+
namelen = strlen (ent->expname) + 1;
elist = GF_CALLOC (1, sizeof (*elist), gf_nfs_mt_exportnode);
if (!elist) {