summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-04-19 11:34:37 +0530
committerAmar Tumballi <amarts@redhat.com>2019-04-24 03:31:17 +0000
commit2d39572821306496c96797f4d122f8200aae4585 (patch)
tree6b487aad233a7e3ed9dc025fa8ab21001c3f3dc7 /xlators/storage
parentd8eadde7d498939c746ea8ddd9dc70a1029b4070 (diff)
ctime: Fix log repeated logging during open
The log "posix set mdata failed, No ctime" logged repeatedly after the fix [1]. Those could be internal fops. This patch fixes the same. [1] https://review.gluster.org/22540 fixes: bz#1701457 Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix-metadata.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c
index 7ff522519d8..e96f222cff4 100644
--- a/xlators/storage/posix/src/posix-metadata.c
+++ b/xlators/storage/posix/src/posix-metadata.c
@@ -429,11 +429,6 @@ posix_set_mdata_xattr(xlator_t *this, const char *real_path, int fd,
}
}
- if ((flag->ctime == 0) && (flag->mtime == 0) && (flag->atime == 0)) {
- ret = 0;
- goto unlock;
- }
-
/* 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
@@ -621,13 +616,9 @@ posix_set_ctime(call_frame_t *frame, xlator_t *this, const char *real_path,
if (priv->ctime) {
(void)posix_get_mdata_flag(frame->root->flags, &flag);
- if (frame->root->ctime.tv_sec == 0) {
- gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_SETMDATA_FAILED,
- "posix set mdata failed, No ctime : %s gfid:%s", real_path,
- inode ? uuid_utoa(inode->gfid) : "No inode");
+ if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
goto out;
}
-
ret = posix_set_mdata_xattr(this, real_path, fd, inode,
&frame->root->ctime, stbuf, &flag,
_gf_false);
@@ -656,6 +647,9 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
if (inode && priv->ctime) {
(void)posix_get_parent_mdata_flag(frame->root->flags, &flag);
+ if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
+ goto out;
+ }
ret = posix_set_mdata_xattr(this, real_path, fd, inode,
&frame->root->ctime, stbuf, &flag,
_gf_false);
@@ -665,6 +659,7 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
uuid_utoa(inode->gfid));
}
}
+out:
return;
}