From 5afc77d585c480f185dd7b24b753a6924218bb86 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 3 Nov 2010 00:34:10 +0000 Subject: mnt3: Fix UMNTALL crash with Windows clients Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 1666 (GlustNFS is incompatible with Windows 7 NFS client.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1666 --- xlators/nfs/server/src/mount3.c | 12 ++++++++---- 1 file 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; } -- cgit