diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-07-17 16:43:30 +0200 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-07-21 14:21:11 +0000 |
commit | b5d0c9b48e87455b961a3e0022de4091d9a4cdf8 (patch) | |
tree | e3cb4a02285148cc4fdb586e5459b5d2d6790a84 /xlators/nfs/server/src/nfs3.h | |
parent | a8d93a1498458a121f8670504dcb639635566347 (diff) |
nfs: make nfs3_call_state_t refcounted
There is no refcounting done of the nfs3_call_state_t structure, which
seems to result in use-after-free problems in the NLM part of
Gluster/NFS. The structure is initialized with two different functions,
it is easier to have a single place to do this.
The Gluster/NFS part will not use the refcounting, for now. This is
being added to make the NLM code more stable. nfs3_call_state_wipe()
will behave as before for Gluster/NFS, but cleanup is triggered through
the refcounting now. This prevents major changes to the stable part of
the NFS-server, and makes it possible to improve the NLM component
separately.
Cherry picked from commit daed52b8ebcac7ef36f11e944f83826f46593867:
> Change-Id: I2e15bcf12af74e8a46c2727e4a160e9444d29ece
> BUG: 1467313
> Signed-off-by: Niels de Vos <ndevos@redhat.com>
> Reviewed-on: https://review.gluster.org/17696
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Amar Tumballi <amarts@redhat.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Change-Id: I2e15bcf12af74e8a46c2727e4a160e9444d29ece
BUG: 1471869
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: https://review.gluster.org/17797
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3.h')
-rw-r--r-- | xlators/nfs/server/src/nfs3.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs3.h b/xlators/nfs/server/src/nfs3.h index 4cb3e67528d..187fb7e1912 100644 --- a/xlators/nfs/server/src/nfs3.h +++ b/xlators/nfs/server/src/nfs3.h @@ -23,6 +23,7 @@ #include "nlm4.h" #include "acl3-xdr.h" #include "acl3.h" +#include "refcount.h" #include <sys/statvfs.h> #define GF_NFS3 GF_NFS"-nfsv3" @@ -184,6 +185,8 @@ typedef int (*nfs3_resume_fn_t) (void *cs); * Imagine the chaos if we need a mem-pool for each one of those sub-structures. */ struct nfs3_local { + GF_REF_DECL; + rpcsvc_request_t *req; xlator_t *vol; nfs3_resume_fn_t resume_fn; |