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