]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-bluestore-tool: the link target should not ending with new line 18623/head
authorYao Zongyou <yaozongyou@vip.qq.com>
Sat, 28 Oct 2017 10:23:30 +0000 (18:23 +0800)
committerSage Weil <sage@redhat.com>
Mon, 30 Oct 2017 12:01:23 +0000 (07:01 -0500)
Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
(cherry picked from commit 39c68d128cf29f8e0a617009d16c5edf471ead47)

src/os/bluestore/bluestore_tool.cc

index 4bc97356728c5cd647529f11472833d9cdce847b..23f0483991ff943991692bc8d7f49d84ef7023e2 100644 (file)
@@ -332,7 +332,6 @@ int main(int argc, char **argv)
        v += label.meta["whoami"];
        v += "]\nkey = " + i->second;
       }
-      v += "\n";
       if (k.find("path_") == 0) {
        p = path + "/" + k.substr(5);
        int r = ::symlink(v.c_str(), p.c_str());
@@ -342,6 +341,7 @@ int main(int argc, char **argv)
          exit(EXIT_FAILURE);
        }
       } else {
+       v += "\n";
        int fd = ::open(p.c_str(), O_CREAT|O_TRUNC|O_WRONLY, 0600);
        if (fd < 0) {
          cerr << "error writing " << p << ": " << cpp_strerror(errno)