summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-07-19 13:53:27 +0200
committerNiels de Vos <ndevos@redhat.com>2017-07-21 10:17:36 +0000
commit890ae2a1b2ce72d22657e7463405e59bee1e298a (patch)
tree8bc0d5c51f6f86203ace00ef10a0ab067595b293 /xlators/nfs/server/src
parentdf85ed48e5e94449cdcc77de3b86e10ccea49f1e (diff)
nfs: improve error handling for WebNFS mount permissions
In case nfs3_funge_webnfs_zerolen_fh() returns an error, the nfs3_call_state_t structure will not get initialized. This means that calling `nfs3_call_state_wipe (cs)` will result in a segmentation fault after commit daed52b8eb that makes nfs3_call_state_t refcounted. Change-Id: I4c300aedf132a7fea95756dd278ff87d67722478 BUG: 1468291 Fixes: e3f48fa2 ("nfs: add permission checking for mounting over WebNFS") Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: https://review.gluster.org/17822 Smoke: Gluster 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: soumya k <skoduri@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src')
-rw-r--r--xlators/nfs/server/src/nfs3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 836428f8111..5f2c442c468 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -1632,7 +1632,8 @@ nfs3err:
NFS3_LOOKUP, stat, -ret,
cs ? cs->resolvedloc.path : NULL);
nfs3_lookup_reply (req, stat, NULL, NULL, NULL);
- nfs3_call_state_wipe (cs);
+ if (cs)
+ nfs3_call_state_wipe (cs);
/* Ret must be 0 after this so that the caller does not
* also send an RPC reply.
*/