osdc/ObjectCacher: set complete flag when we observe ENOENT

If we observe an ENOENT on a read, set the complete flag.  Any dirty
buffers we have will still be in memory, even if the write are in flight,
because the TX state remains pinned until the writes commit.  Writes cannot
proceed faster than reads, even though reads may proceed faster than
writes.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-10-24 14:41:38 -07:00
parent 94d2b91d5b
commit b9b1be6d68

View File

@ -562,6 +562,11 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, loff_t start,
} else {
Object *ob = objects[poolid][oid];
if (r == -ENOENT && !ob->complete) {
ldout(cct, 7) << "bh_read_finish ENOENT, marking complete on " << *ob << dendl;
ob->complete = true;
}
// apply to bh's!
loff_t opos = start;
while (true) {