]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: drop workaround for embedded null decoding
authorSage Weil <sage@newdream.net>
Wed, 8 Jun 2011 22:57:46 +0000 (15:57 -0700)
committerSage Weil <sage@newdream.net>
Wed, 8 Jun 2011 22:57:57 +0000 (15:57 -0700)
We removed the embedded null check recently, 9b37f4f, so this workaround
isn't needed.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/mdstypes.h

index da54bf07e67c87f35ad7028ff566f554c2e6ee80..2f142d6b64a1fc9ee31a0aac1d1620ea51d77f66 100644 (file)
@@ -817,23 +817,10 @@ struct cap_reconnect_t {
     ::encode_nohead(flockbl, bl);
   }
   void decode(bufferlist::iterator& bl) {
-    decode_path(path, bl);
+    ::decode(path, bl);
     ::decode(capinfo, bl);
     ::decode_nohead(capinfo.flock_len, flockbl, bl);
   }
-private:
-  void decode_path(std::string &path, bufferlist::iterator& p) {
-    // Bypass the check for embedded NULLs by decoding into a raw byte buffer.
-    // We sometimes get paths with embedded NULLs from old kernel clients.
-    __u32 len;
-    ::decode(len, p);
-    if (len > PATH_MAX)
-      throw buffer::malformed_input("cap_reconnect_t::decode_path: PATH too long!");
-    char str[len + 1];
-    memset(str, 0, sizeof(str));
-    p.copy(len, str);
-    path = str;
-  }
 };
 WRITE_CLASS_ENCODER(cap_reconnect_t)