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