From: Adam Kupczyk Date: Tue, 30 Jan 2024 12:54:26 +0000 (+0000) Subject: os/bluestore: Fix read_main_bdev_label X-Git-Tag: v19.2.1~271^2~35 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9fa091bd01a7ed40668edd6d0df71cf9ea2d6a61;p=ceph.git os/bluestore: Fix read_main_bdev_label When valid label with new epoch is found, all that we have marked as good before are released. Signed-off-by: Adam Kupczyk (cherry picked from commit c4f212ee1fc331c8de8949999c6a56948617d43e) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e00aedc1f7172..eda144b56925c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6678,9 +6678,13 @@ int BlueStore::_read_main_bdev_label( *out_is_multi = true; } if(out_valid_positions) { - out_valid_positions->push_back(position); + // clear out old versions + out_valid_positions->clear(); } } + if(v == epoch && out_valid_positions) { + out_valid_positions->push_back(position); + } } } else if (r == 1) { // tried to read but no disk