Patchwork [BUG:944,3/6] mount3: Handle <volname> as well for unmount dirpath

login
register
Submitter Shehjar Tikoo
Date 2010-06-01 04:13:54
Message ID <1275365637-30417-3-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/3356/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Shehjar Tikoo - 2010-06-01 04:13:54
From: Shehjar Tikoo <shehjart@gluster.com>

Till now nfsx would crash if the export was mounted simply as
<volname> as compared to the traditional method of /<volname>.

Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
---
 xlators/nfs/server/src/mount3.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index db4a88e..e1fffe9 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -514,7 +514,10 @@  __mnt3svc_umount (struct mount3_state *ms, char *dirpath, char *hostname)
                 return 0;
 
         list_for_each_entry (me, &ms->mountlist, mlist) {
-                exname = dirpath+1;
+                if (dirpath[0] == '/')
+                        exname = dirpath+1;
+                else
+                        exname = dirpath;
                 if ((strcmp (me->exname, exname) == 0) &&
                     (strcmp (me->hostname, hostname) == 0))
                         break;