From: Sage Weil Date: Wed, 6 Apr 2016 01:26:06 +0000 (-0400) Subject: os/bluestore: use short, relative paths with bluefs X-Git-Tag: v10.1.2~45^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8431%2Fhead;p=ceph.git 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 --- 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);