Patchwork [BUG:2483] NFS : Check for duplicate entries while filling up child_up array.

login
register
Submitter Gaurav
Date 2011-03-03 07:34:51
Message ID <1299137691-5770-1-git-send-email-gaurav@gluster.com>
Download mbox | patch
Permalink /patch/6322/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Gaurav - 2011-03-03 07:34:51
From: Gaurav <gaurav@gluster.com>


Signed-off-by: Gaurav <gaurav@gluster.com>
---
 xlators/nfs/server/src/nfs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index ad66410..8df7c13 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -205,6 +205,13 @@  nfs_subvolume_set_started (struct nfs_state *nfs, xlator_t *xl)
         LOCK (&nfs->svinitlock);
         {
                 for (;x < nfs->allsubvols; ++x) {
+                        if (nfs->initedxl[x] == xl) {
+                                gf_log (GF_NFS, GF_LOG_DEBUG,
+                                        "Volume already started %s",
+                                        xl->name);
+                                break;
+                        }
+
                         if (nfs->initedxl[x] == NULL) {
                                 nfs->initedxl[x] = xl;
                                 ++nfs->upsubvols;