From 6fde5e3411d44c752d81006d35f19e92e23441af Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Tue, 24 May 2016 19:14:41 +0530 Subject: snapshot/uss: client log is filled with "invalid argument: inode" error svc_inode_ctx_get is called even if inode is NULL. We should not call this function if inode is NULL > BUG: 1339149 > Signed-off-by: Rajesh Joseph > Reviewed-on: http://review.gluster.org/14525 > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Jeff Darcy (cherry picked from commit edcc6a4ef4f39d5e3073195d45011e3cdfa7c091) BUG: 1367297 Signed-off-by: Rajesh Joseph Change-Id: I5c3f17633ca88e5b6f40d4acf14a09e14b7ef62b Reviewed-on: http://review.gluster.org/15170 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Tested-by: Avra Sengupta Reviewed-by: Avra Sengupta Reviewed-by: Niels de Vos --- xlators/features/snapview-client/src/snapview-client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 76b4bc3b7f4..6eb7cc071c2 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -287,12 +287,16 @@ gf_svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ? GF_LOG_DEBUG:GF_LOG_ERROR, "Lookup failed on snapview graph with error %s", strerror (op_errno)); + goto out; } if ((op_errno == ENOENT || op_errno == ESTALE) && !gf_uuid_is_null (local->loc.gfid)) { - ret = svc_inode_ctx_get (this, inode, &inode_type); - if (ret < 0 && subvolume == FIRST_CHILD (this)) { + if (inode != NULL) + ret = svc_inode_ctx_get (this, inode, + &inode_type); + + if (ret < 0 || inode == NULL) { gf_log (this->name, GF_LOG_DEBUG, "Lookup on normal graph failed. " "Sending lookup to snapview-server"); -- cgit