233933
From 03c0395a1ead769167046713a99662bc5c5233fa Mon Sep 17 00:00:00 2001
233933
From: Kotresh HR <khiremat@redhat.com>
233933
Date: Fri, 19 Apr 2019 11:34:37 +0530
233933
Subject: [PATCH 123/124] ctime: Fix log repeated logging during open
233933
233933
The log "posix set mdata failed, No ctime" logged repeatedly
233933
after the fix [1]. Those could be internal fops. This patch
233933
fixes the same.
233933
233933
[1] https://review.gluster.org/22540
233933
233933
Backport of:
233933
 > Patch: https://review.gluster.org/22591
233933
 > fixes: bz#1701457
233933
 > Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650
233933
 > Signed-off-by: Kotresh HR <khiremat@redhat.com>
233933
233933
BUG: 1699709
233933
Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650
233933
Signed-off-by: Kotresh HR <khiremat@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/168688
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
233933
---
233933
 xlators/storage/posix/src/posix-metadata.c | 15 +++++----------
233933
 1 file changed, 5 insertions(+), 10 deletions(-)
233933
233933
diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c
233933
index 7ff5225..e96f222 100644
233933
--- a/xlators/storage/posix/src/posix-metadata.c
233933
+++ b/xlators/storage/posix/src/posix-metadata.c
233933
@@ -429,11 +429,6 @@ posix_set_mdata_xattr(xlator_t *this, const char *real_path, int fd,
233933
             }
233933
         }
233933
 
233933
-        if ((flag->ctime == 0) && (flag->mtime == 0) && (flag->atime == 0)) {
233933
-            ret = 0;
233933
-            goto unlock;
233933
-        }
233933
-
233933
         /* Earlier, mdata was updated only if the existing time is less
233933
          * than the time to be updated. This would fail the scenarios
233933
          * where mtime can be set to any time using the syscall. Hence
233933
@@ -621,13 +616,9 @@ posix_set_ctime(call_frame_t *frame, xlator_t *this, const char *real_path,
233933
 
233933
     if (priv->ctime) {
233933
         (void)posix_get_mdata_flag(frame->root->flags, &flag;;
233933
-        if (frame->root->ctime.tv_sec == 0) {
233933
-            gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_SETMDATA_FAILED,
233933
-                   "posix set mdata failed, No ctime : %s gfid:%s", real_path,
233933
-                   inode ? uuid_utoa(inode->gfid) : "No inode");
233933
+        if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
233933
             goto out;
233933
         }
233933
-
233933
         ret = posix_set_mdata_xattr(this, real_path, fd, inode,
233933
                                     &frame->root->ctime, stbuf, &flag,
233933
                                     _gf_false);
233933
@@ -656,6 +647,9 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
233933
 
233933
     if (inode && priv->ctime) {
233933
         (void)posix_get_parent_mdata_flag(frame->root->flags, &flag;;
233933
+        if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
233933
+            goto out;
233933
+        }
233933
         ret = posix_set_mdata_xattr(this, real_path, fd, inode,
233933
                                     &frame->root->ctime, stbuf, &flag,
233933
                                     _gf_false);
233933
@@ -665,6 +659,7 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
233933
                    uuid_utoa(inode->gfid));
233933
         }
233933
     }
233933
+out:
233933
     return;
233933
 }
233933
 
233933
-- 
233933
1.8.3.1
233933