From: Jeff Layton Date: Mon, 1 Aug 2016 13:01:15 +0000 (-0400) Subject: ceph: don't fudge the ctime in stat() unless it's really older than the mtime X-Git-Tag: v10.2.4~69^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0db9fb831dc67ae138056c2f03c31dcc7f6adbf;p=ceph.git ceph: don't fudge the ctime in stat() unless it's really older than the mtime The current code just looks at the sec field, but the difference may only be evident in the nsec field. Signed-off-by: Jeff Layton (cherry picked from commit 14ee7bcbf0bdd6553dc1b78898ae429aae644100) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 3b0b00e315a..d78d38c86dc 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6642,7 +6642,7 @@ int Client::fill_stat(Inode *in, struct stat *st, frag_info_t *dirstat, nest_inf st->st_nlink = in->nlink; st->st_uid = in->uid; st->st_gid = in->gid; - if (in->ctime.sec() > in->mtime.sec()) { + if (in->ctime > in->mtime) { stat_set_ctime_sec(st, in->ctime.sec()); stat_set_ctime_nsec(st, in->ctime.nsec()); } else {