From: Sage Weil Date: Mon, 29 Oct 2012 15:33:52 +0000 (-0700) Subject: os/chain_xattr: fix listxattr buffer size X-Git-Tag: v0.55~188^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b7f89cb7b0f51df9b0264c20acfab863bf6a655f;p=ceph.git os/chain_xattr: fix listxattr buffer size Intenrally allocate 2x the raw listxattr result; tell the user the same. Signed-off-by: Sage Weil --- diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc index bab02726c0e..ea9bcdd202f 100644 --- a/src/os/chain_xattr.cc +++ b/src/os/chain_xattr.cc @@ -335,7 +335,7 @@ int chain_listxattr(const char *fn, char *names, size_t len) { int r; if (!len) - return ::ceph_os_listxattr(fn, names, len); + return ::ceph_os_listxattr(fn, names, len) * 2; r = ::ceph_os_listxattr(fn, 0, 0); if (r < 0) @@ -381,7 +381,7 @@ int chain_flistxattr(int fd, char *names, size_t len) { int r; if (!len) - return ::ceph_os_flistxattr(fd, names, len); + return ::ceph_os_flistxattr(fd, names, len) * 2; r = ::ceph_os_flistxattr(fd, 0, 0); if (r < 0)