summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2012-12-19 11:27:57 +0530
committerAnand Avati <avati@redhat.com>2013-01-17 00:26:57 -0800
commit2a4c48b4ed0d1b04ad218ace529e24a96d4f0f3b (patch)
tree417f244d25d0dfb44ba3c77e47518de0a6a356e7
parent8b87819b9f374f78d13746878d6ed7a260a8ae9a (diff)
cluster/dht: update ctx-time only if we receive the new iatt
1. Used local->postparent(contains merged iatt of all succesful calls) instead of postparent for dht ctx time update. 2. dht_inode_ctx_time_update avoided in case of opret -1. Change-Id: Ie04a7842a41c241f911b6a3f76267b996d27fb43 BUG: 881013 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/4338 Reviewed-by: Shishir Gowda <sgowda@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
-rw-r--r--xlators/cluster/dht/src/dht-helper.c5
2 files changed, 8 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 70e737c89..ded86bcc3 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -701,7 +701,7 @@ cont:
if (local->loc.parent) {
dht_inode_ctx_time_update (local->loc.parent, this,
- postparent, 1);
+ &local->postparent, 1);
}
DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
@@ -754,12 +754,12 @@ dht_lookup_linkfile_create_cbk (call_frame_t *frame, void *cookie,
local->stbuf.ia_prot.sticky = 1;
}
-unwind:
if (local->loc.parent) {
dht_inode_ctx_time_update (local->loc.parent, this,
postparent, 1);
}
+unwind:
DHT_STRIP_PHASE1_FLAGS (&local->stbuf);
DHT_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno,
local->inode, &local->stbuf, local->xattr,
@@ -1133,12 +1133,12 @@ dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie,
op_errno = EINVAL;
}
-unwind:
if (local->loc.parent) {
dht_inode_ctx_time_update (local->loc.parent, this,
postparent, 1);
}
+unwind:
DHT_STRIP_PHASE1_FLAGS (stbuf);
DHT_STACK_UNWIND (lookup, frame, op_ret, op_errno, inode, stbuf, xattr,
postparent);
@@ -1322,7 +1322,7 @@ out:
* from each of the subvolume. See dht_iatt_merge for reference.
*/
- if (local->loc.parent) {
+ if (!op_ret && local->loc.parent) {
dht_inode_ctx_time_update (local->loc.parent, this,
postparent, 1);
}
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 264172a90..8a38de475 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -931,6 +931,9 @@ dht_inode_ctx_time_update (inode_t *inode, xlator_t *this, struct iatt *stat,
dht_stat_time_t *time = 0;
int ret = -1;
+ GF_VALIDATE_OR_GOTO (this->name, stat, out);
+ GF_VALIDATE_OR_GOTO (this->name, inode, out);
+
ret = dht_inode_ctx_get (inode, this, &ctx);
if (ret) {
@@ -949,7 +952,7 @@ dht_inode_ctx_time_update (inode_t *inode, xlator_t *this, struct iatt *stat,
stat->ia_atime, stat->ia_atime_nsec, inode, post);
ret = dht_inode_ctx_set (inode, this, ctx);
-
+out:
return 0;
}