diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-02-15 09:57:34 +0100 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-02-15 18:19:57 -0500 |
commit | 06ab8673f5b0ebe37d358bb6d46bc58fda4a5c83 (patch) | |
tree | b1c97b735cf6932dd88d5971dccfe8ed158ddf87 /xlators/nfs | |
parent | 5d8951afdc083008ad1d6f930291b36dca86c94f (diff) |
gNFS: Keep the mountdict as long as the service is active
We initialize and take ref once on mountdict during NFS/MNT3 server
initialization but seem to be unref'in it for every UMNTALL request.
This can lead to crash when there are multiple UMNTALL requests
with >=1 active mount entry(/ies) in the mountlist.
Since we take the ref only once, we should keep the mountdict through
out the life of the process and dereference it only during unitialization
of mnt3 service.
Cherry picked from commit a88ae92de190af0956013780939ba6bdfd509ff8:
> Change-Id: I3238a8df09b8972e56dd93fee426d866d40d9959
> BUG: 1421759
> Signed-off-by: Soumya Koduri <skoduri@redhat.com>
> Reviewed-on: https://review.gluster.org/16611
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Change-Id: I3238a8df09b8972e56dd93fee426d866d40d9959
BUG: 1422391
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: https://review.gluster.org/16625
Reviewed-by: soumya k <skoduri@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index 4fb4b757423..823b94dd3ca 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -2543,8 +2543,6 @@ __mnt3svc_umountall (struct mount3_state *ms) GF_FREE (me); } - dict_unref (ms->mountdict); - return 0; } @@ -3938,7 +3936,13 @@ mnt3svc_deinit (xlator_t *nfsx) mnt3_auth_params_deinit (mstate->auth_params); /* Unmount everything and clear mountdict */ - mnt3svc_umountall (mstate); + LOCK (&mstate->mountlock); + { + __mnt3svc_umountall (mstate); + dict_unref (mstate->mountdict); + } + UNLOCK (&mstate->mountlock); + } rpcsvc_program_t * |