]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use the whole string as the snapshot long name 45192/head
authorXiubo Li <xiubli@redhat.com>
Mon, 28 Feb 2022 09:56:37 +0000 (17:56 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 14 Apr 2022 12:21:53 +0000 (20:21 +0800)
The length of encrypted the snapshot name will be longer than normal
name and we need the whole encrypted name in kclient to do the base64
decode.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/mds/snap.cc

index c5b8728e927149548d7c02b9d655df9b179a72ce..38942f22a3aad5c4d25fd0f67dc11c7bed7b1506 100644 (file)
@@ -84,9 +84,9 @@ std::string_view SnapInfo::get_long_name() const
   if (long_name.empty() ||
       long_name.compare(1, name.size(), name) ||
       long_name.find_last_of("_") != name.size() + 1) {
-    char nm[80];
-    snprintf(nm, sizeof(nm), "_%s_%llu", name.c_str(), (unsigned long long)ino);
-    long_name = nm;
+    std::ostringstream oss;
+    oss << "_" << name << "_" << (unsigned long long)ino;
+    long_name = oss.str();
   }
   return long_name;
 }