]> git-server-git.apps.pok.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:06 +0000 (13:10 -0700)
commit0e2bfe71965eeef29b47e8032637ea820a7ce49c
tree06a023c41adbf34e1ff41644872fb3d908fc3fb4
parent6b51c960715971a0351e8203d4896cb0c4138a3f
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