From 07761f2a3a9a7bd1fef04c5e658e8e4204cd808e Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Fri, 26 May 2017 05:55:47 -0700 Subject: [PATCH] os/bluestore: introduce debug parameter to bypass bdev verification E.g. this allows to backup WAL/DB volumes after preconditioning and quickly rollback to that state when needed. Signed-off-by: Igor Fedotov --- src/common/config_opts.h | 1 + src/os/bluestore/BlueStore.cc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 6d8febf0dc556..c5dceea0649ee 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -1173,6 +1173,7 @@ OPTION(bluestore_debug_inject_read_err, OPT_BOOL, false) OPTION(bluestore_debug_randomize_serial_transaction, OPT_INT, 0) OPTION(bluestore_debug_omit_block_device_write, OPT_BOOL, false) OPTION(bluestore_debug_fsck_abort, OPT_BOOL, false) +OPTION(bluestore_debug_permit_any_bdev_label, OPT_BOOL, false) OPTION(bluestore_shard_finishers, OPT_BOOL, false) OPTION(kstore_max_ops, OPT_U64, 512) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 26bd3dac20e14..3904737aa0b4c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3823,7 +3823,11 @@ int BlueStore::_check_or_set_bdev_label( int r = _read_bdev_label(cct, path, &label); if (r < 0) return r; - if (label.osd_uuid != fsid) { + if (cct->_conf->bluestore_debug_permit_any_bdev_label) { + dout(20) << __func__ << " bdev " << path << " fsid " << label.osd_uuid + << " and fsid " << fsid << " check bypassed" << dendl; + } + else if (label.osd_uuid != fsid) { derr << __func__ << " bdev " << path << " fsid " << label.osd_uuid << " does not match our fsid " << fsid << dendl; return -EIO; -- 2.39.5