]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Modified Files:
authorcarlosm <carlosm@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 13 Jul 2005 02:22:58 +0000 (02:22 +0000)
committercarlosm <carlosm@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 13 Jul 2005 02:22:58 +0000 (02:22 +0000)
  client/Buffercache.cc

Another bug in map_existing: need_off was not correctly advanced

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@456 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/Buffercache.cc

index 21f0c51696a6166782f327a4ee794a56b6b221b6..292e9aa7a9bad341db294aea5ff7971cd0a51349 100644 (file)
@@ -259,18 +259,21 @@ Filecache::map_existing(size_t len,
     if (actual_off > need_off) {
       holes[need_off] = (size_t) (actual_off - need_off);
       dout(10) << "bc: map: hole " << need_off << " " << holes[need_off] << endl;
+      need_off = actual_off;
     }
     if (bh->state == BUFHD_STATE_RX) {
       rx[actual_off] = bh;
       dout(10) << "bc: map: rx " << actual_off << " " << rx[actual_off]->miss_len << endl;
+      need_off = actual_off + bh->miss_len;
     } else if (bh->state == BUFHD_STATE_TX) {
       tx[actual_off] = bh;
       dout(10) << "bc: map: tx " << actual_off << " " << tx[actual_off]->bl.length() << endl;
+      need_off = actual_off + bh->bl.length();
     } else {
       hits[actual_off] = bh;
       dout(10) << "bc: map: hits " << actual_off << " " << hits[actual_off]->bl.length() << endl;
+      need_off = actual_off + bh->bl.length();
     }
-    need_off = actual_off + bh->bl.length();
   }
   if (need_off < start_off + len) {
     holes[need_off] = (size_t) (start_off + len - need_off);