]> git.apps.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>
Mon, 18 Nov 2019 09:14:25 +0000 (12:14 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit d3308d2cc17b0a12480e5dce850d2bda84985add)

src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 2b44c4ee112c5b8e920193adb88e281935cbfaf0..643675f9984ae7bac11d4c466446066b9b072741 100644 (file)
@@ -6759,6 +6759,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);
@@ -6773,13 +6774,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;
@@ -8144,7 +8149,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 6eaf6494db5a255b45db877d1354eeaecde5b384..d21ae0dc05af31f1022ace5863fe2713609ca5e9 100644 (file)
@@ -2356,6 +2356,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);