From dbf0ca53a5704c7f94257fc4223b41865458301a Mon Sep 17 00:00:00 2001 From: Sakshi Bansal Date: Thu, 4 Feb 2016 16:02:59 +0530 Subject: dht: mkdir must unwind with latest ctime Currently fops like mkdir used the the ctime it gets after creating the directory entry. But setting layout also updates the ctime of a directory. Hence DHT must get the ctime after the setxattr call and unwind with the latest ctime to avoid mismatch in time seen by applications like tar. Change-Id: Iecbbe3aac5244af5da9788b48ccf299ca56b4bae BUG: 1302948 Signed-off-by: Sakshi Bansal Reviewed-on: http://review.gluster.org/13352 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G --- xlators/cluster/dht/src/dht-common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 5886886e830..f5fd0bd7858 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -198,6 +198,7 @@ dht_lookup_selfheal_cbk (call_frame_t *frame, void *cookie, ret = dht_layout_set (this, local->inode, layout); } + dht_inode_ctx_time_update (local->inode, this, &local->stbuf, 1); if (local->loc.parent) { dht_inode_ctx_time_update (local->loc.parent, this, &local->postparent, 1); @@ -705,6 +706,8 @@ unlock: dht_layout_set (this, local->inode, layout); } + dht_inode_ctx_time_update (local->inode, this, + &local->stbuf, 1); if (local->loc.parent) { dht_inode_ctx_time_update (local->loc.parent, this, &local->postparent, 1); @@ -6487,6 +6490,9 @@ dht_mkdir_selfheal_cbk (call_frame_t *frame, void *cookie, if (op_ret == 0) { dht_layout_set (this, local->inode, layout); + + dht_inode_ctx_time_update (local->inode, this, + &local->stbuf, 1); if (local->loc.parent) { dht_inode_ctx_time_update (local->loc.parent, this, &local->preparent, 0); -- cgit