]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PGBackend: use mtime for digest decision if local_mtime is empty
authorSage Weil <sage@redhat.com>
Mon, 14 Dec 2015 17:59:29 +0000 (12:59 -0500)
committerSage Weil <sage@redhat.com>
Tue, 15 Dec 2015 02:07:14 +0000 (21:07 -0500)
If we don't have a local_mtime value, use mtime instead, for the purposes
of deciding if we should record a digest after scrub.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PGBackend.cc

index 7fc56d10fa49087a0d16a14d45bfdceb19623fb5..2b897d7f8e0b764daf54bfdbe8501ffb52fc9767 100644 (file)
@@ -675,7 +675,10 @@ void PGBackend::be_compare_scrubmaps(
        update = MAYBE;
       }
       if (update != NO) {
-       utime_t age = now - auth_oi.local_mtime;
+       utime_t mtime = auth_oi.local_mtime;
+       if (mtime == utime_t())
+         mtime = auth_oi.mtime;
+       utime_t age = now - mtime;
        if (update == FORCE ||
            age > g_conf->osd_deep_scrub_update_digest_min_age) {
          dout(20) << __func__ << " will update digest on " << *k << dendl;