From c23a651b7e9fce8a51e3d9656cc64a49ff42aef7 Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Tue, 24 May 2016 14:33:54 +0530 Subject: snapshot/uss: client-side log is filled with "invalid-argument" error xdata is used without checking if it is NULL or not. > BUG: 1339149 > Signed-off-by: Rajesh Joseph > Reviewed-on: http://review.gluster.org/14511 > Smoke: Gluster Build System > Reviewed-by: Raghavendra Talur > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System (cherry picked from commit f55a973e581aaa25bbe38be83e007e1b2eaed659) BUG: 1367297 Signed-off-by: Rajesh Joseph Change-Id: Ib6ddaab28ec3b430b8d646aada0456d3cc9978cb Reviewed-on: http://review.gluster.org/15171 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Avra Sengupta Reviewed-by: Niels de Vos --- xlators/features/snapview-client/src/snapview-client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 218d178f65f..76b4bc3b7f4 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -1658,6 +1658,9 @@ gf_svc_readdirp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; + if (local->xdata != NULL) + dict_unref (xdata); + if (op_ret) { op_ret = 0; op_errno = ENOENT; @@ -1795,7 +1798,10 @@ gf_svc_readdir_on_special_dir (call_frame_t *frame, void *cookie, } local->cookie = cookie; - local->xdata = dict_ref (xdata); + if (xdata == NULL) + local->xdata = NULL; + else + local->xdata = dict_ref (xdata); STACK_WIND (frame, gf_svc_readdirp_lookup_cbk, SECOND_CHILD (this), SECOND_CHILD (this)->fops->lookup, loc, tmp_xdata); -- cgit