target/file: Fix 32-bit highmem breakage for SGL -> iovec mapping
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 5 Dec 2012 11:08:29 +0000 (12:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jun 2014 19:04:21 +0000 (12:04 -0700)
commit82b9ccd651eb90f28b4336554d82ea0ab9067c63
tree297a05c4eaff132a27645ef59f35f9736321fdb7
parent2b102fcef6a89e1bc0b7116125a82b3b03d57d89
target/file: Fix 32-bit highmem breakage for SGL -> iovec mapping

commit 40ff2c3b3da35dd3a00ac6722056a59b4b3f2caf upstream.

This patch changes vectored file I/O to use kmap + kunmap when mapping
incoming SGL memory -> struct iovec in order to properly support 32-bit
highmem configurations.  This is because an extra bounce buffer may be
required when processing scatterlist pages allocated with GFP_KERNEL.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[bwh: Backported to 3.2: use task->task_sg{,_nents} for iteration]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_file.c