From: Igor Fedotov Date: Mon, 9 Sep 2019 13:46:31 +0000 (+0300) Subject: os/bluestore: fix warning counting in fsck X-Git-Tag: v14.2.5~17^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d5d6baf5208afaae0dbb0be3a47747cf21344c4c;p=ceph.git os/bluestore: fix warning counting in fsck Signed-off-by: Igor Fedotov (cherry picked from commit d3308d2cc17b0a12480e5dce850d2bda84985add) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2b44c4ee112c5..643675f9984ae 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 6eaf6494db5a2..d21ae0dc05af3 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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);