]> 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>
Fri, 16 Aug 2013 05:20:21 +0000 (22:20 -0700)
commitb59f930ae147767eb4c9ff18c3821f6936a83227
tree74a1ac95df08b21e7199252df6a697d9fc15b001
parent067d5756a8b17af16ce73a487698471c079a2fb6
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>
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h