]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix warning counting in fsck
authorIgor Fedotov <ifedotov@suse.com>
Mon, 9 Sep 2019 13:46:31 +0000 (16:46 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Thu, 12 Sep 2019 18:09:57 +0000 (21:09 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 1f3d330105771adde544b2424bcb98fbfd7722c0..7e786498c8c6abd63ecaed8d5ef6f3ad98a833ac 100644 (file)
@@ -7004,6 +7004,7 @@ void BlueStore::_fsck_check_pool_statfs(
   BlueStore::per_pool_statfs& expected_pool_statfs,
   bool need_per_pool_stats,
   int64_t& errors,
+  int64_t& warnings,
   BlueStoreRepairer* repairer)
 {
   auto it = db->get_iterator(PREFIX_STAT);
@@ -7018,13 +7019,17 @@ void BlueStore::_fsck_check_pool_statfs(
            derr << "fsck error: " << "legacy statfs record found, removing" << dendl;
          } else {
            derr << "fsck warning: " << "legacy statfs record found, bypassing" << dendl;
+            ++warnings;
          }
        } else {
-         const char* s = "fsck warning: ";
+         const char* s;
           if (need_per_pool_stats) {
            ++errors;
            s = "fsck error: ";
-         }
+         } else {
+            s = "fsck warning: ";
+            ++warnings;
+          }
          derr << s << "legacy statfs record found, suggest to "
                  "run store repair/quick_fix to get consistent statistic reports"
               << dendl;
@@ -8483,7 +8488,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
   if (!enforce_no_per_pool_stats) {
     dout(1) << __func__ << " checking pool_statfs" << dendl;
     _fsck_check_pool_statfs(expected_pool_statfs, need_per_pool_stats,
-      errors, repair ? &repairer : nullptr);
+      errors, warnings, repair ? &repairer : nullptr);
   }
 
   if (depth != FSCK_SHALLOW) {
index dd544e8a04358de2c2127df86d6854722fbdb580..1409db3430e10f16804717dd6487f50cfb36069e 100644 (file)
@@ -2246,6 +2246,7 @@ private:
     per_pool_statfs& expected_pool_statfs,
     bool need_per_pool_stats,
     int64_t& errors,
+    int64_t &warnings,
     BlueStoreRepairer* repairer);
 
   int _fsck(FSCKDepth depth, bool repair);