From 25d80078e2e2ebb040c48ffab25483a585cd6784 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 5 Apr 2016 21:26:06 -0400 Subject: [PATCH] os/bluestore: use short, relative paths with bluefs If we're using bluefs, only pass in the short relative path (db, db.wal, db.slow). The leading components are ignored and only lead to errors if the configuration provides relative paths that do not match (e.g., if one if using ceph-objectstore-tool). Fixes: http://tracker.ceph.com/issues/15376 Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8c710d87ef07..451262dbb548 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1215,16 +1215,17 @@ int BlueStore::_open_db(bool create) bluefs_extents.insert(BLUEFS_START, initial); } + // use a short, relative path, if it's bluefs. + strcpy(fn, "db"); + if (bluefs_shared_bdev == BlueFS::BDEV_SLOW) { // we have both block.db and block; tell rocksdb! // note: the second (last) size value doesn't really matter char db_paths[PATH_MAX*3]; snprintf( - db_paths, sizeof(db_paths), "%s/db,%lld %s/db.slow,%lld", - path.c_str(), + db_paths, sizeof(db_paths), "db,%lld db.slow,%lld", (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_DB) * 95 / 100, - path.c_str(), (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_SLOW) * 95 / 100); g_conf->set_val("rocksdb_db_paths", db_paths, false, false); -- 2.47.3