From: Igor Fedotov Date: Mon, 9 Sep 2019 13:46:31 +0000 (+0300) Subject: os/bluestore: fix warning counting in fsck X-Git-Tag: v15.1.0~1544^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3308d2cc17b0a12480e5dce850d2bda84985add;p=ceph.git os/bluestore: fix warning counting in fsck Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1f3d3301057..7e786498c8c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index dd544e8a043..1409db3430e 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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);