]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
objectstore: do not include 0-length bufferptr in bufferlist if attr not found
authorSage Weil <sage@newdream.net>
Wed, 29 Oct 2008 18:13:18 +0000 (11:13 -0700)
committerSage Weil <sage@newdream.net>
Wed, 29 Oct 2008 18:13:18 +0000 (11:13 -0700)
Having a "null" bufferptr causes problems in a number of places down the
line.  We want an empty bufferlist instead.

src/os/ObjectStore.h

index 4fde2157252772d3b4af4d43850cdf918b5e8af5..8cb7111033bb9fe35d278ae8e3850c37d0f8bd20 100644 (file)
@@ -402,7 +402,8 @@ public:
   int getattr(coll_t cid, pobject_t oid, const char *name, bufferlist& value) {
     bufferptr bp;
     int r = getattr(cid, oid, name, bp);
-    value.push_back(bp);
+    if (bp.length())
+      value.push_back(bp);
     return r;
   }
   virtual int getattrs(coll_t cid, pobject_t oid, map<string,bufferptr>& aset) {return 0;};