]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen-blkfront: handle bvecs with partial data
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 7 Dec 2012 18:00:31 +0000 (19:00 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 7 Dec 2012 19:28:09 +0000 (14:28 -0500)
commite4e9686605d8f0a1479e15e2d4990cc414fbd2b1
tree2d0999f2faac64f06a2578eec64efe52ca22600d
parent591115de983d0af52c5a1fe41d94d65c5662843e
xen-blkfront: handle bvecs with partial data

Currently blkfront fails to handle cases in blkif_completion like the
following:

1st loop in rq_for_each_segment
 * bv_offset: 3584
 * bv_len: 512
 * offset += bv_len
 * i: 0

2nd loop:
 * bv_offset: 0
 * bv_len: 512
 * i: 0

In the second loop i should be 1, since we assume we only wanted to
read a part of the previous page. This patches fixes this cases where
only a part of the shared page is read, and blkif_completion assumes
that if the bv_offset of a bvec is less than the previous bv_offset
plus the bv_size we have to switch to the next shared page.

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: linux-kernel@vger.kernel.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c