Skip to content

Commit

Permalink
objectcacher: write vs truncate races are ok
Browse files Browse the repository at this point in the history
It is possible to write a buffer, truncate it away, and then not have it
when we get the commit.

Fixes: ceph#1467
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Sep 1, 2011
1 parent b2c762b commit c8c205f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osdc/ObjectCacher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start,
<< dendl;
if (objects[poolid].count(oid) == 0) {
ldout(cct, 7) << "bh_write_commit no object cache" << dendl;
assert(0);
} else {
Object *ob = objects[poolid][oid];

Expand All @@ -642,7 +641,8 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start,
p++) {
BufferHead *bh = p->second;

if (bh->start() > start+(loff_t)length) break;
if (bh->start() > start+(loff_t)length)
break;

if (bh->start() < start &&
bh->end() > start+(loff_t)length) {
Expand Down

0 comments on commit c8c205f

Please sign in to comment.