summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker-quota.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2016-03-16 13:31:10 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-03-21 23:28:56 -0700
commit68665d0fc4a827e9933b94da8c4a2977b1a5cee6 (patch)
tree8c8966b8c8d23f0c363ac764d42262cf1b105b5e /xlators/features/marker/src/marker-quota.c
parent8eaa3506ead4f11b81b146a9e56575c79f3aad7b (diff)
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 <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13748 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/marker/src/marker-quota.c')
-rw-r--r--xlators/features/marker/src/marker-quota.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index e12cfab..7de0dd5 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: