From 68665d0fc4a827e9933b94da8c4a2977b1a5cee6 Mon Sep 17 00:00:00 2001 From: vmallika Date: Wed, 16 Mar 2016 13:31:10 +0530 Subject: marker: set inode ctx before lookup unwind When a file is unlinked before it was accounted by the marker, then we may see error "ctx for the node ... is NULL" at many places. This is actually not an error and can be ignored. It is better to set the inode ctx before lookup/create is unwind back to protocol server Change-Id: I462b5542951f2fc2964f59af7a31978979dab1de BUG: 1318158 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/13748 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- xlators/features/marker/src/marker-quota.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'xlators/features/marker/src/marker-quota.c') diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index e12cfab2527..7de0dd57a56 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -1033,26 +1033,14 @@ mq_prevalidate_txn (xlator_t *this, loc_t *origin_loc, loc_t *loc, } } - if (ctx) - ret = mq_inode_ctx_get (loc->inode, this, ctx); - else - ret = mq_inode_ctx_get (loc->inode, this, &ctxtmp); - + ret = mq_inode_ctx_get (loc->inode, this, &ctxtmp); if (ret < 0) { - if (ctx) { - *ctx = mq_inode_ctx_new (loc->inode, this); - if (*ctx == NULL) { - gf_log_callingfn (this->name, GF_LOG_WARNING, - "mq_inode_ctx_new failed for " - "%s", loc->path); - ret = -1; - goto out; - } - } else { - gf_log_callingfn (this->name, GF_LOG_WARNING, "ctx for " - "is NULL for %s", loc->path); - } + gf_log_callingfn (this->name, GF_LOG_WARNING, "inode ctx for " + "is NULL for %s", loc->path); + goto out; } + if (ctx) + *ctx = ctxtmp; ret = 0; out: -- cgit