[SCSI] sg: fix iovec bugs introduced by the block layer conversion
commit0fdf96b67ac2649cc1ddb29b316a0db11586c6a8
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fri, 3 Apr 2009 00:12:20 +0000 (3 09:12 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Apr 2009 14:25:23 +0000 (3 09:25 -0500)
treee70a5d8babcae1ec25c0df0722291b31df62a7cb
parentf894e74dc1983062d30d4e1b79bdb90b8a847f52
[SCSI] sg: fix iovec bugs introduced by the block layer conversion

- needs to use copy_from_user for iovec before passing it to
blk_rq_map_user_iov().

- before the block layer conversion, if ->dxfer_len and sum of iovec
disagrees, the shorter one wins. However, currently sg returns
-EINVAL. This restores the old behavior.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sg.c