From 40936fb1f5f23891d012579a0acf6ef6038d19f3 Mon Sep 17 00:00:00 2001 From: Jianjian Huo Date: Wed, 10 Feb 2016 20:44:33 -0500 Subject: [PATCH] os/bluestore: fix a typo in SPDK path parsing 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 --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2643b88b8e15..d35cd44156cc 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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) { -- 2.47.3