From: Sage Weil Date: Wed, 11 Oct 2017 21:33:54 +0000 (-0500) Subject: os/bluestore: keep meta items for extra bdev paths X-Git-Tag: v13.0.1~508^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d07fa5ad0772b4d979dc10695d230074d1f1e69;p=ceph.git os/bluestore: keep meta items for extra bdev paths Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2d50103412a..da1c488d048 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4564,7 +4564,9 @@ int BlueStore::_open_db(bool create) string bfn; struct stat st; - bfn = path + "/block.db"; + if (read_meta("path_block.db", &bfn) < 0) { + bfn = path + "/block.db"; + } if (::stat(bfn.c_str(), &st) == 0) { r = bluefs->add_block_device(BlueFS::BDEV_DB, bfn); if (r < 0) { @@ -4603,7 +4605,9 @@ int BlueStore::_open_db(bool create) } // shared device - bfn = path + "/block"; + if (read_meta("path_block", &bfn) < 0) { + bfn = path + "/block"; + } r = bluefs->add_block_device(bluefs_shared_bdev, bfn); if (r < 0) { derr << __func__ << " add block device(" << bfn << ") returned: " @@ -4632,7 +4636,9 @@ int BlueStore::_open_db(bool create) bluefs_extents.insert(start, initial); } - bfn = path + "/block.wal"; + if (read_meta("path_block.wal", &bfn) < 0) { + bfn = path + "/block.wal"; + } if (::stat(bfn.c_str(), &st) == 0) { r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn); if (r < 0) { @@ -5256,6 +5262,17 @@ int BlueStore::mkfs() if (r < 0) goto out_close_fsid; + { + string wal_path = cct->_conf->get_val("bluestore_block_wal_path"); + if (wal_path.size()) { + write_meta("path_block.wal", wal_path); + } + string db_path = cct->_conf->get_val("bluestore_block_db_path"); + if (db_path.size()) { + write_meta("path_block.db", db_path); + } + } + // choose min_alloc_size if (cct->_conf->bluestore_min_alloc_size) { min_alloc_size = cct->_conf->bluestore_min_alloc_size; @@ -5311,7 +5328,7 @@ int BlueStore::mkfs() if (r < 0) goto out_close_fm; - r = write_meta("bluefs", stringify((int)cct->_conf->bluestore_bluefs)); + r = write_meta("bluefs", stringify(bluefs ? 1 : 0)); if (r < 0) goto out_close_fm;