]> git.baikalelectronics.ru Git - kernel.git/commit
iscsi-target: Fix iov_count calculation bug in iscsit_allocate_iovecs
authorNicholas Bellinger <nab@linux-iscsi.org>
Mon, 21 May 2012 00:10:29 +0000 (17:10 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 21 May 2012 00:25:24 +0000 (17:25 -0700)
commite5cc5173ba02b4fa7af3160c7673c5724aa6144d
tree0b348e90da1ce8e98d45346084ad2a1be47cbc78
parent640aaf74965c0959e90a5ce2bc5e6900bdc4d646
iscsi-target: Fix iov_count calculation bug in iscsit_allocate_iovecs

This patch fixes a bug in iscsit_allocate_iovecs() where iov_count was
incorrectly calculated using min(1UL, data_length / PAGE_SIZE) instead of
max(1UL, data_length / PAGE_SIZE), that ends up triggering an OOPs for
large block I/O when the SGL <-> iovec mapping exceeds the bogus iov_count
allocation size.

This is a regression introduced during the iscsi-target conversion back
to using core memory allocation here:

commit 93ee11cf9ea005edb73f0b8d13a626c1867a5812
Author: Andy Grover <agrover@redhat.com>
Date:   Tue Apr 3 15:51:29 2012 -0700

    target/iscsi: Go back to core allocating data buffer for cmd

Cc: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c