]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: don't fudge the ctime in stat() unless it's really older than the mtime 10877/head
authorJeff Layton <jlayton@redhat.com>
Mon, 1 Aug 2016 13:01:15 +0000 (09:01 -0400)
committerLoic Dachary <ldachary@redhat.com>
Thu, 25 Aug 2016 16:30:42 +0000 (18:30 +0200)
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 <jlayton@redhat.com>
(cherry picked from commit 14ee7bcbf0bdd6553dc1b78898ae429aae644100)

src/client/Client.cc

index 3b0b00e315a9bab4b9c3c9ec7e8d1161cd0a1b1c..d78d38c86dc85462b1e781c2cdc6494f1cb759a7 100644 (file)
@@ -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 {