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