diff options
author | Kotresh HR <khiremat@redhat.com> | 2019-08-08 10:05:12 +0530 |
---|---|---|
committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-08-30 09:24:10 +0000 |
commit | 4ca8dd7e24b40a156c7f4ba41f1d7da91ac21d84 (patch) | |
tree | ee1060a3639d70eb1dc17dde9825241506730eeb /xlators/features/utime | |
parent | f7d1fa51cf7308a6d68ed9fa1e8cc4a7c66ad121 (diff) |
ctime: Fix ctime issue with utime family of syscalls
When atime|mtime is updated via utime family of syscalls,
ctime is not updated. This patch fixes the same.
Backport of:
> Patch: https://review.gluster.org/23177/
> Change-Id: I7f86d8f8a1e06a332c3449b5bbdbf128c9690f25
> BUg: 1738786
> Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 95f71df31dc73d85df722b0e7d3a7eb1e0237e7f)
Change-Id: I7f86d8f8a1e06a332c3449b5bbdbf128c9690f25
Signed-off-by: Kotresh HR <khiremat@redhat.com>
fixes: bz#1746138
Diffstat (limited to 'xlators/features/utime')
-rwxr-xr-x | xlators/features/utime/src/utime-gen-fops-c.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/features/utime/src/utime-gen-fops-c.py b/xlators/features/utime/src/utime-gen-fops-c.py index a8637ffe6f6..8730a51d13e 100755 --- a/xlators/features/utime/src/utime-gen-fops-c.py +++ b/xlators/features/utime/src/utime-gen-fops-c.py @@ -82,7 +82,18 @@ gf_utime_@NAME@ (call_frame_t *frame, xlator_t *this, @LONG_ARGS@) { gl_timespec_get(&frame->root->ctime); - frame->root->flags |= MDATA_CTIME; + + if (!valid) { + frame->root->flags |= MDATA_CTIME; + } + + if (valid & (GF_SET_ATTR_UID | GF_SET_ATTR_GID)) { + frame->root->flags |= MDATA_CTIME; + } + + if (valid & GF_SET_ATTR_MODE) { + frame->root->flags |= MDATA_CTIME; + } STACK_WIND (frame, gf_utime_@NAME@_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->@NAME@, @SHORT_ARGS@); |