]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: use short, relative paths with bluefs 8431/head
authorSage Weil <sage@redhat.com>
Wed, 6 Apr 2016 01:26:06 +0000 (21:26 -0400)
committerSage Weil <sage@redhat.com>
Wed, 6 Apr 2016 01:26:06 +0000 (21:26 -0400)
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 <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 8c710d87ef07c6c91fe458ea1083d727e48b4651..451262dbb548e3e480029eaaa8b445de86a2acc7 100644 (file)
@@ -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);