os/DBOjectMap : iter->valid is always false if we do not initialize the iterator with init(), seek_to_first will initialize this iterator

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
This commit is contained in:
xinxin shu 2015-06-01 14:28:32 +08:00
parent a1de1fc20e
commit 440ef3a230

View File

@ -772,7 +772,7 @@ int DBObjectMap::get_keys(const ghobject_t &oid,
if (!header)
return -ENOENT;
ObjectMapIterator iter = get_iterator(oid);
for (; iter->valid(); iter->next()) {
for (iter->seek_to_first(); iter->valid(); iter->next()) {
if (iter->status())
return iter->status();
keys->insert(iter->key());