]> git.karo-electronics.de Git - karo-tx-linux.git/commit
target: support zero allocation length in INQUIRY
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 Sep 2012 15:30:38 +0000 (17:30 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 7 Sep 2012 18:51:51 +0000 (11:51 -0700)
commit7c711e4220f7302419c8942d6b739fca03aabb0a
tree420a05c83ad5c7350d78a8cc3a3a7f225d8a8c2a
parent2c4d84b9824e979bb8a3c7d1b41ee28284704ab8
target: support zero allocation length in INQUIRY

INQUIRY processing already uses an on-heap bounce buffer for loopback,
but not for other fabrics.  Switch this to a cheaper on-stack bounce
buffer, similar to the one used by MODE SENSE and REQUEST SENSE, and
use it unconditionally.  With this in place, zero allocation length is
handled simply by checking the return address of transport_kmap_data_sg.

Testcase: sg_raw /dev/sdb 12 00 83 00 00 00
    should fail with ILLEGAL REQUEST / INVALID FIELD IN CDB sense
    does not fail without the patch
    fails correctly with the series

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_spc.c