From: Sage Weil Date: Wed, 29 Oct 2008 18:13:18 +0000 (-0700) Subject: objectstore: do not include 0-length bufferptr in bufferlist if attr not found X-Git-Tag: v0.5~168 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=111e851becb4abddb0f49cda31bc94e577d835fb;p=ceph.git objectstore: do not include 0-length bufferptr in bufferlist if attr not found Having a "null" bufferptr causes problems in a number of places down the line. We want an empty bufferlist instead. --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 4fde21572527..8cb7111033bb 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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& aset) {return 0;};