From: Sage Weil Date: Thu, 7 Sep 2017 16:29:32 +0000 (-0400) Subject: os/bluestore: allow repair invocation X-Git-Tag: v12.2.2~133^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68642c43384d5a30155cd67129267d38d6cc3a06;p=ceph.git os/bluestore: allow repair invocation Signed-off-by: Sage Weil (cherry picked from commit 659fcd279ae82c90172fd6ca07a032d75fe50c96) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 9cac297379e8..a11d1c930e44 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5510,10 +5510,13 @@ int BlueStore::_fsck_check_extents( return errors; } -int BlueStore::fsck(bool deep) +int BlueStore::_fsck(bool deep, bool repair) { - dout(1) << __func__ << (deep ? " (deep)" : " (shallow)") << " start" << dendl; + dout(1) << __func__ + << (repair ? " fsck" : " repair") + << (deep ? " (deep)" : " (shallow)") << " start" << dendl; int errors = 0; + int repaired = 0; typedef btree::btree_set< uint64_t,std::less, @@ -6114,9 +6117,10 @@ int BlueStore::fsck(bool deep) << dendl; utime_t duration = ceph_clock_now() - start; - dout(1) << __func__ << " finish with " << errors << " errors in " + dout(1) << __func__ << " finish with " << errors << " errors, " << repaired + << " repaired, " << (errors - repaired) << " remaining in " << duration << " seconds" << dendl; - return errors; + return errors - repaired; } void BlueStore::collect_metadata(map *pm) diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 5325b2f6e2f2..a98d70a633c4 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -2150,7 +2150,13 @@ public: return 0; } - int fsck(bool deep) override; + int fsck(bool deep) override { + return _fsck(deep, false); + } + int repair(bool deep) override { + return _fsck(deep, true); + } + int _fsck(bool deep, bool repair); void set_cache_shards(unsigned num) override;