aboutsummaryrefslogtreecommitdiff
path: root/net/lapb
diff options
context:
space:
mode:
authorAkinobu Mita <[email protected]>2013-07-08 16:01:57 -0700
committerLinus Torvalds <[email protected]>2013-07-09 10:33:30 -0700
commita451751172b39702e94c683882ab01d816b673c7 (patch)
tree27a77c2517c4c8af1dcb81c8a6cea0d3c9fba5c3 /net/lapb
parentd05257238f9bbe96477162448c2dda08309af208 (diff)
scsi_debug: fix do_device_access() with wrap around range
do_device_access() is a function that abstracts copying SG list from/to ramdisk storage (fake_storep). It must deal with the ranges exceeding actual fake_storep size, because such ranges are valid if virtual_gb is set greater than zero, and they should be treated as fake_storep is repeatedly mirrored up to virtual size. Unfortunately, it can't deal with the range which wraps around the end of fake_storep. A wrap around range is copied by two sg_copy_{from,to}_buffer() calls, but sg_copy_{from,to}_buffer() can't copy from/to in the middle of SG list, therefore the second call can't copy correctly. This fixes it by using sg_pcopy_{from,to}_buffer() that can copy from/to the middle of SG list. This also simplifies the assignment of sdb->resid in fill_from_dev_buffer(). Because fill_from_dev_buffer() is now only called once per command execution cycle. So it is not necessary to take care to decrease sdb->resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Horia Geanta <[email protected]> Cc: Imre Deak <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb')
0 files changed, 0 insertions, 0 deletions