]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: allow repair invocation
authorSage Weil <sage@redhat.com>
Thu, 7 Sep 2017 16:29:32 +0000 (12:29 -0400)
committerSage Weil <sage@redhat.com>
Thu, 14 Sep 2017 16:15:01 +0000 (12:15 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 1bbba5ede3a9f513c7d1a8ac30e97571f7ed833a..04de42e5b1b4a363d583aad78ca7967c7e50c574 100644 (file)
@@ -5481,10 +5481,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<uint64_t>,
@@ -6071,9 +6074,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<string,string> *pm)
index 218124e66a4b84b5fdf85aeab33cfa056fb1f08f..4dd75d4fd65a267ddae3b5d5ad3e53d1396c3f54 100644 (file)
@@ -2144,7 +2144,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;