diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-11-03 00:34:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-11-03 04:25:54 -0700 |
commit | 5afc77d585c480f185dd7b24b753a6924218bb86 (patch) | |
tree | ae351c75dee6758b249a85ac13adb6bc39347bab | |
parent | 428b6edc2e141ec701e4a8b0f2964bf251e0014b (diff) |
mnt3: Fix UMNTALL crash with Windows clients
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1666 (GlustNFS is incompatible with Windows 7 NFS client.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1666
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index fdd05a269..47158dcca 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -1078,11 +1078,15 @@ int __mnt3svc_umountall (struct mount3_state *ms) { struct mountentry *me = NULL; + struct mountentry *tmp = NULL; if (!ms) return -1; - list_for_each_entry (me, &ms->mountlist, mlist) { + if (list_empty (&ms->mountlist)) + return 0; + + list_for_each_entry_safe (me, tmp, &ms->mountlist, mlist) { list_del (&me->mlist); GF_FREE (me); } @@ -1111,18 +1115,17 @@ mnt3svc_umountall (struct mount3_state *ms) int mnt3svc_umntall (rpcsvc_request_t *req) { - int ret = -1; + int ret = RPCSVC_ACTOR_ERROR; struct mount3_state *ms = NULL; mountstat3 mstat = MNT3_OK; if (!req) - return -1; + return ret; ms = (struct mount3_state *)nfs_rpcsvc_request_program_private (req); if (!ms) { gf_log (GF_MNT, GF_LOG_ERROR, "Mount state not present"); nfs_rpcsvc_request_seterr (req, SYSTEM_ERR); - ret = -1; goto rpcerr; } @@ -1130,6 +1133,7 @@ mnt3svc_umntall (rpcsvc_request_t *req) mnt3svc_submit_reply (req, &mstat, (mnt3_serializer)xdr_serialize_mountstat3); + ret = RPCSVC_ACTOR_SUCCESS; rpcerr: return ret; } |