From: Jianjian Huo Date: Thu, 11 Feb 2016 01:44:33 +0000 (-0500) Subject: os/bluestore: fix a typo in SPDK path parsing X-Git-Tag: v10.1.0~409^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=40936fb1f5f23891d012579a0acf6ef6038d19f3;p=ceph.git 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 --- 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) {