From 33475a32bc6688284aea7eaf13f3c17848db4526 Mon Sep 17 00:00:00 2001 From: carlosm Date: Wed, 13 Jul 2005 02:22:58 +0000 Subject: [PATCH] Modified Files: 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ceph/client/Buffercache.cc b/ceph/client/Buffercache.cc index 21f0c51696a..292e9aa7a9b 100644 --- a/ceph/client/Buffercache.cc +++ b/ceph/client/Buffercache.cc @@ -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);