]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objectcacher: write vs truncate races are ok
authorSage Weil <sage@newdream.net>
Thu, 1 Sep 2011 20:14:11 +0000 (13:14 -0700)
committerSage Weil <sage@newdream.net>
Thu, 1 Sep 2011 20:15:21 +0000 (13:15 -0700)
It is possible to write a buffer, truncate it away, and then not have it
when we get the commit.

Fixes: #1467
Signed-off-by: Sage Weil <sage@newdream.net>
src/osdc/ObjectCacher.cc

index 19ef1224b57c11f2cb6133acaa01f622d1ba58a2..a4dad0ddf1aca7746b3c2b73ddeaeb03c94551ee 100644 (file)
@@ -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];
     
@@ -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) {