From 9bc0c31613a5eefce894c842be5a158a85bc72a1 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 26 Jan 2016 17:25:42 +0800 Subject: [PATCH] BlueStore: try to scan as many errors as possible Signed-off-by: xie xingguo --- src/os/bluestore/BlueStore.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 480b60d5ed8df..c9181bc81147d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1945,13 +1945,13 @@ int BlueStore::fsck() // walk collections, objects for (ceph::unordered_map::iterator p = coll_map.begin(); - p != coll_map.end() && !errors; + p != coll_map.end(); ++p) { dout(1) << __func__ << " collection " << p->first << dendl; CollectionRef c = _get_collection(p->first); RWLock::RLocker l(c->lock); ghobject_t pos; - while (!errors) { + while (true) { vector ols; int r = collection_list(p->first, pos, ghobject_t::get_max(), true, 100, &ols, &pos); @@ -1967,7 +1967,7 @@ int BlueStore::fsck() OnodeRef o = c->get_onode(oid, false); if (!o || !o->exists) { ++errors; - break; + continue; // go for next object } if (!enode || enode->hash != o->oid.hobj.get_hash()) { if (enode) @@ -1980,7 +1980,7 @@ int BlueStore::fsck() derr << " " << oid << " nid " << o->onode.nid << " already in use" << dendl; ++errors; - break; + continue; // go for next object } used_nids.insert(o->onode.nid); } @@ -2129,7 +2129,7 @@ int BlueStore::fsck() c = NULL; for (ceph::unordered_map::iterator p = coll_map.begin(); - p != coll_map.end() && !errors; + p != coll_map.end(); ++p) { if (p->second->contains(oid)) { c = p->second; -- 2.39.5