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: ses5-milestone5~230^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10386%2Fhead;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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 93ffd07bb29c..2df632fc0e08 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6681,7 +6681,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 {