]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix libstriprados::stat, use strtoll insdead of strtol 3921/head
authorDongmao Zhang <deanraccoon@gmail.com>
Fri, 14 Nov 2014 10:48:58 +0000 (18:48 +0800)
committerSebastien Ponce <sebastien.ponce@cern.ch>
Tue, 10 Mar 2015 08:02:31 +0000 (09:02 +0100)
The return value(long int) of strict_strtol is too small for unstriped
object.

Signed-off-by: Dongmao Zhang <deanraccoon@gmail.com>
(cherry picked from commit fe6679dca479fc24806d7e57ab0108a516cd6d55)

src/libradosstriper/RadosStriperImpl.cc

index e1dbded402d4c7c5b2494288b03cef9a92e2c001..3b42541ea856f966d1bd127255107dcd448cd3c0 100644 (file)
@@ -529,7 +529,7 @@ int libradosstriper::RadosStriperImpl::stat(const std::string& soid, uint64_t *p
   std::string err;
   // this intermediate string allows to add a null terminator before calling strtol
   std::string strsize(bl.c_str(), bl.length());
-  *psize = strict_strtol(strsize.c_str(), 10, &err);
+  *psize = strict_strtoll(strsize.c_str(), 10, &err);
   if (!err.empty()) {
     lderr(cct()) << XATTR_SIZE << " : " << err << dendl;
     return -EINVAL;