From: Sage Weil Date: Wed, 8 Jun 2011 22:57:46 +0000 (-0700) Subject: mds: drop workaround for embedded null decoding X-Git-Tag: v0.30~99 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=92ee0de8361e8ff0999999c9852b4d297ac037c1;p=ceph.git mds: drop workaround for embedded null decoding We removed the embedded null check recently, 9b37f4f, so this workaround isn't needed. Signed-off-by: Sage Weil --- diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index da54bf07e67c..2f142d6b64a1 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -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)