From 2a4c48b4ed0d1b04ad218ace529e24a96d4f0f3b Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Wed, 19 Dec 2012 11:27:57 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/4338 Reviewed-by: Shishir Gowda Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/dht/src/dht-helper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/dht-helper.c') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 264172a90ab..8a38de475d9 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; } -- cgit