]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osdc/ObjectCacher: match reads with their original rx buffers
authorSage Weil <sage@inktank.com>
Fri, 16 Aug 2013 04:47:18 +0000 (21:47 -0700)
committerSage Weil <sage@inktank.com>
Mon, 26 Aug 2013 20:10:16 +0000 (13:10 -0700)
commit02da55757a9fb53df4746db5dd14724e77da95b6
treee225e2ea59f3ef026e5de9494c2aea16e91c06ba
parent43e7ad989dcb4deb18b32ec31f76c8755354d2a6
osdc/ObjectCacher: match reads with their original rx buffers

Consider a sequence like:

 1- start read on 100~200
       100~200 state rx
 2- truncate to 200
       100~100 state rx
 3- start read on 200~200
       100~100 state rx
       200~200 state rx
 4- get 100~200 read result

Currently this makes us crash on

osdc/ObjectCacher.cc: 738: FAILED assert(bh->length() <= start+(loff_t)length-opos)

when processing the second 200~200 bufferhead (it is too big).  The
larger issue, though, is that we should not be looking at this data at
all; it has been truncated away.

Fix this by marking each rx buffer with the read request that is sent to
fill it, and only fill it from that read request.  Then the first reply
will fill the first 100~100 extend but not touch the other extent; the
second read will do that.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit b59f930ae147767eb4c9ff18c3821f6936a83227)
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h