]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: fix getattr return value when using omap
authorSage Weil <sage@inktank.com>
Wed, 23 Oct 2013 02:39:51 +0000 (19:39 -0700)
committerSage Weil <sage@inktank.com>
Fri, 25 Oct 2013 19:49:57 +0000 (12:49 -0700)
The return value should be the length of the value, even when it was
stored in omap.

Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc

index 6940dff140569252840dbf395960c4e9222e3538..ffac501aaf20d78394af99489a3b7bce0ed29407 100644 (file)
@@ -3424,7 +3424,7 @@ int FileStore::getattr(coll_t cid, const ghobject_t& oid, const char *name, buff
     }
     bp = bufferptr(got.begin()->second.c_str(),
                   got.begin()->second.length());
-    r = 0;
+    r = bp.length();
   }
  out:
   dout(10) << "getattr " << cid << "/" << oid << " '" << name << "' = " << r << dendl;