]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix a typo in SPDK path parsing 7601/head
authorJianjian Huo <samuel.huo@gmail.com>
Thu, 11 Feb 2016 01:44:33 +0000 (20:44 -0500)
committerJianjian Huo <samuel.huo@gmail.com>
Thu, 11 Feb 2016 01:44:33 +0000 (20:44 -0500)
SPDK block path with bluestore is something like spdk:55cd2e404bd73932.
The size of the prefix to compare should be 5.
sizeof(SPDK_PREFIX)-1 returns 5, while sizeof(SPDK_PREFIX-1) returns 8.

Signed-off-by: Jianjian Huo <samuel.huo@gmail.com>
src/os/bluestore/BlueStore.cc

index 2643b88b8e15046e0e032edcca2df974d25acace..d35cd44156cc3c2ce0855063733d383dd12216c8 100644 (file)
@@ -1579,7 +1579,7 @@ int BlueStore::_setup_block_symlink_or_file(
           << " size " << size << " create=" << (int)create << dendl;
   int r = 0;
   if (epath.length()) {
-    if (!epath.compare(0, sizeof(SPDK_PREFIX-1), SPDK_PREFIX)) {
+    if (!epath.compare(0, sizeof(SPDK_PREFIX)-1, SPDK_PREFIX)) {
       string symbol_spdk_file = path + "/" + epath;
       r = ::symlinkat(symbol_spdk_file.c_str(), path_fd, name.c_str());
       if (r < 0) {