From 6623055696e1b28267305ac45087497f4c6a884a Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 25 Nov 2010 04:11:09 +0000 Subject: 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 Signed-off-by: Anand V. Avati 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 --- xlators/nfs/server/src/nfs.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'xlators/nfs/server/src/nfs.c') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 5f116a3b7..001df8eeb 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -639,6 +639,13 @@ init (xlator_t *this) { goto err; } + ret = nfs_init_versions (nfs, this); + if (ret == -1) { + gf_log (GF_NFS, GF_LOG_CRITICAL, "Failed to initialize " + "protocols"); + goto err; + } + ret = 0; err: if (ret == 0) @@ -653,7 +660,6 @@ notify (xlator_t *this, int32_t event, void *data, ...) { struct nfs_state *nfs = NULL; xlator_t *subvol = NULL; - int ret = -1; nfs = (struct nfs_state *)this->private; subvol = (xlator_t *)data; @@ -662,21 +668,9 @@ notify (xlator_t *this, int32_t event, void *data, ...) event); switch (event) { - case GF_EVENT_CHILD_CONNECTING: case GF_EVENT_CHILD_UP: { nfs_startup_subvolume (this, subvol); - if ((nfs->upsubvols == nfs->allsubvols) && - (!nfs->subvols_started)) { - nfs->subvols_started = 1; - gf_log (GF_NFS, GF_LOG_TRACE, "All children up," - " starting RPC"); - ret = nfs_init_versions (nfs, this); - if (ret == -1) - gf_log (GF_NFS, GF_LOG_CRITICAL, - "Failed to initialize " - "protocols"); - } break; } -- cgit