]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: be_compare_scrubmaps uses incorrect j iterator 3237/head
authorLoic Dachary <ldachary@redhat.com>
Mon, 22 Dec 2014 16:05:50 +0000 (17:05 +0100)
committerLoic Dachary <ldachary@redhat.com>
Mon, 22 Dec 2014 16:05:50 +0000 (17:05 +0100)
The code moved from be_select_auth_object to be_compare_scrubmaps
74bd8708dfbfd3c8e7ba3f41d8534609dcbc1237 but the j iterator is use
differently although it has the same type. Use map.begin() as a
fallback instead.

http://tracker.ceph.com/issues/10408 Fixes: #10408

Signed-off-by: Loic Dachary <ldachary@dachary.org>
src/osd/PGBackend.cc

index f0a73ff335c9f8b6e3527a009f0a8fd56a0b566e..6a3e640e3ca13f425a6b98805ec185e31211f936 100644 (file)
@@ -566,8 +566,9 @@ void PGBackend::be_compare_scrubmaps(
       // Something is better than nothing
       // TODO: something is NOT better than nothing, do something like
       // unfound_lost if no valid copies can be found, or just mark unfound
-      auth = j;
-      dout(10) << __func__ << ": selecting osd " << j->first
+      map<pg_shard_t, ScrubMap *>::const_iterator fallback = maps.begin();
+      auth = fallback;
+      dout(10) << __func__ << ": selecting osd " << fallback->first
               << " for obj " << *k
               << ", something is better than nothing, FIXME"
               << dendl;