]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bits
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 18 Dec 2007 17:56:41 +0000 (17:56 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 18 Dec 2007 17:56:41 +0000 (17:56 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2221 29311d96-e01e-0410-9327-a35deaab8ce9

branches/ebofs/ebofs/BufferCache.cc
branches/ebofs/ebofs/Ebofs.cc

index c8bfba9902493027c0261373d81cb0e788651592..9fe8db19e5cdeb60eb0427614e1807371b0832ed 100644 (file)
@@ -1282,15 +1282,15 @@ void BufferCache::rx_finish(ObjectCache *oc,
       block_t pblock = diskstart;
 
       // verify csum
+      csum_t want = sp->second.csum;
       csum_t actual = calc_csum(bl.c_str(), bl.length());
-      if (actual != sp->second.csum || rand() % 5 == 0) {
+      if (actual != want || rand() % 5 == 0) {
        dout(0) << "rx_finish bad csum on partial block " << pblock << dendl;
        derr(0) << "rx_finish bad csum on partial block " << pblock << " ****************" << dendl;
        poison_commit = true;
        *sp->second.on->get_extent_csum_ptr(sp->second.oblock, 1) = actual;
        sp->second.on->data_csum += actual - want;
 
-
        interval_set<off_t> bad;
        bad.insert(sp->second.oblock*EBOFS_BLOCK_SIZE, EBOFS_BLOCK_SIZE);
        sp->second.on->bad_byte_extents.union_of(bad);
index 14ff96e7879f90d2ec1920e962e9da2caf337d0d..35002a54cb56d80fdd47ae0c17e38659908d4fe6 100644 (file)
@@ -1617,6 +1617,21 @@ void Ebofs::apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl)
 
   block_t bstart = off / EBOFS_BLOCK_SIZE;
 
+  // partial?
+  off_t last_block_byte = on->last_block * EBOFS_BLOCK_SIZE;
+  bool partial_head = (off & EBOFS_BLOCK_MASK) && off < last_block_byte;
+  bool partial_tail = ((off+len) & EBOFS_BLOCK_MASK) && (off+len) < on->object_size;
+
+    partial_head
+    if ((bh->start() == bstart && 
+        opos % EBOFS_BLOCK_SIZE != 0) ||
+        (bh->last() == blast && 
+        ((off_t)len+off) % EBOFS_BLOCK_SIZE != 0 && 
+        ((off_t)len+off) < on->object_size)) {
+
+
+
+      // extending object?
   if (off+(off_t)len > on->object_size) {
     dout(10) << "apply_write extending size on " << *on << ": " << on->object_size 
              << " -> " << off+len << dendl;
@@ -1629,7 +1644,6 @@ void Ebofs::apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl)
   block_t blen = blast-bstart+1;
   block_t oldlastblock = on->last_block;
 
-
   // map b range onto buffer_heads
   map<block_t, BufferHead*> hits;
   oc->map_write(bstart, blen, hits, super_epoch);