diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2019-08-05 11:08:02 +0800 |
---|---|---|
committer | Kotresh HR <khiremat@redhat.com> | 2019-08-06 06:05:21 +0000 |
commit | 0486821b33b2ece4058a78058f9f3e2f7149d8a7 (patch) | |
tree | 41fc900ab6cd43af2588c0d8df81cc5006753273 /xlators/storage | |
parent | 80fa433be6e399311a6bcaa1e074bc1ae65122e2 (diff) |
features/utime: always update ctime at setattr
For the nfs EXCLUSIVE mode create may sets a later time
to mtime (at verifier), it should not set to ctime for
storage.ctime does not allowed set ctime to a earlier time.
/* Earlier, mdata was updated only if the existing time is less
* than the time to be updated. This would fail the scenarios
* where mtime can be set to any time using the syscall. Hence
* just updating without comparison. But the ctime is not
* allowed to changed to older date.
*/
According to kernel's setattr, always set ctime at setattr,
and doesnot set ctime from mtime at storage.ctime.
Change-Id: I5cfde6cb7f8939da9617506e3dc80bd840e0d749
fixes: bz#1737288
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix-metadata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c index 57791fa9536..5cbdc988fb1 100644 --- a/xlators/storage/posix/src/posix-metadata.c +++ b/xlators/storage/posix/src/posix-metadata.c @@ -631,7 +631,7 @@ posix_update_utime_in_mdata(xlator_t *this, const char *real_path, int fd, tv.tv_sec = stbuf->ia_mtime; SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, stbuf->ia_mtime_nsec); - flag.ctime = 1; + flag.ctime = 0; flag.mtime = 1; flag.atime = 0; |