From: Igor Fedotov Date: Fri, 26 May 2017 12:55:47 +0000 (-0700) Subject: os/bluestore: introduce debug parameter to bypass bdev verification X-Git-Tag: v12.1.0~225^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=07761f2a3a9a7bd1fef04c5e658e8e4204cd808e;p=ceph.git 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 --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 6d8febf0dc55..c5dceea0649e 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 26bd3dac20e1..3904737aa0b4 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;