]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Fix to client filepath initializing
authorSam Lang <sam.lang@inktank.com>
Tue, 25 Sep 2012 21:48:32 +0000 (14:48 -0700)
committerSam Lang <sam.lang@inktank.com>
Tue, 25 Sep 2012 21:48:32 +0000 (14:48 -0700)
The filepath constructor that takes a const char * is missing the
initializer for the encoded member.  This results in uninitialized
memory, so the encoded field is sometimes true, resulting in mds
crashes (see #3186) and client errors with empty components in path
names.  This commit fixes #3186 and #2285.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/include/filepath.h

index 884707591977c9e80e1d48555b10a90e37d7aef9..ec1519d5464e4cf80fbcffd907ab7e676cea0d00 100644 (file)
@@ -90,7 +90,7 @@ class filepath {
    * if we are fed a relative path as a string, either set ino=0 (strictly
    * relative) or 1 (absolute).  throw out any leading '/'.
    */
-  filepath(const char *s) {
+  filepath(const char *s) : encoded(false) {
     set_path(s);
   }
   void set_path(const char *s) {