diff options
author | Sakshi Bansal <sabansal@redhat.com> | 2016-02-04 16:02:59 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-02-29 20:54:12 -0800 |
commit | 080af56a02aeec20899ecbc7202a8d293378c1f9 (patch) | |
tree | 66e33128af91626d67e495726d93e218dbfeafc0 /xlators/cluster/dht/src/dht-common.c | |
parent | c2b565904c9d2fdcb30ae21b5d77464415a05cd1 (diff) |
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.
Backport of http://review.gluster.org/#/c/13352/
> Change-Id: Iecbbe3aac5244af5da9788b48ccf299ca56b4bae
> BUG: 1302948
> Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
> Reviewed-on: http://review.gluster.org/13352
> Smoke: Gluster Build System <jenkins@build.gluster.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1312721
Change-Id: Ie09342d3705b40ce98b2935f05ad4402f74ba069
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/13536
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/cluster/dht/src/dht-common.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f8fba8e9d31..fc7b272d51c 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -203,6 +203,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); @@ -710,6 +711,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); @@ -6490,6 +6493,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); |