From 890ae2a1b2ce72d22657e7463405e59bee1e298a Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 19 Jul 2017 13:53:27 +0200 Subject: 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 Reviewed-on: https://review.gluster.org/17822 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: jiffin tony Thottan Reviewed-by: soumya k --- xlators/nfs/server/src/nfs3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. */ -- cgit