]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix fallback logic; move into be_select_auth_object
authorSage Weil <sage@redhat.com>
Fri, 27 Mar 2015 17:03:22 +0000 (10:03 -0700)
committerSage Weil <sage@redhat.com>
Tue, 7 Apr 2015 18:42:14 +0000 (11:42 -0700)
The fallback behavior was printing a promising message but then doing
a 'continue' and not actually scrubbing the object.  Instead, fall back to
a less-bad auth inside be_select_auth_object.

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

index 0ba4c24c08560af24c99500a77eb38791f10dc5f..95b177f2fd680abf9c4e5b20b1dfcf80ed2a6790 100644 (file)
@@ -498,6 +498,12 @@ map<pg_shard_t, ScrubMap *>::const_iterator
       // invalid object info, probably corrupt
       continue;
     }
+
+    // note candidate in case we can't find anything better, because
+    // something is better than nothing.  FIXME.
+    auth = j;
+    *auth_oi = oi;
+
     uint64_t correct_size = be_get_ondisk_size(oi.size);
     if (correct_size != i->second.size) {
       // invalid size, probably corrupt
@@ -528,12 +534,12 @@ map<pg_shard_t, ScrubMap *>::const_iterator
        continue;
       }
     }
-    dout(10) << __func__ << ": selecting osd " << j->first
-            << " for obj " << obj
-            << dendl;
-    auth = j;
-    *auth_oi = oi;
+    break;
   }
+  dout(10) << __func__ << ": selecting osd " << auth->first
+          << " for obj " << obj
+          << " with oi " << *auth_oi
+          << dendl;
   return auth;
 }