]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix regression bug with handling of zero-length data CDBs
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 17 Aug 2012 00:06:41 +0000 (17:06 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 18 Aug 2012 00:24:11 +0000 (17:24 -0700)
commitf1592ea1c461d1275e441d1470cd495d1a443a74
treed41a876e1046dbfbd89ba4a89960d8e52de12887
parent19f97f3dd65b058710d4eea3d3d9e602663c365a
target: Fix regression bug with handling of zero-length data CDBs

This patch fixes a regression bug with the handling of zero-length
data CDBs within transport_generic_new_cmd() code.  The bug was introduced
with the following commit as part of the single task conversion work:

  commit 8a7cf051c835e998d90b1b71563efffb7c8e278d
  Author: Christoph Hellwig <hch@infradead.org>
  Date:   Tue Apr 24 00:25:03 2012 -0400

      target: always allocate a single task

where the zero-length check for SCF_SCSI_DATA_SG_IO_CDB was incorrectly
changed to SCF_SCSI_CONTROL_SG_IO_CDB because of the seperate comment
in transport_generic_new_cmd() wrt to control CDBs zero-length handling
introduced in:

  commit 533a4bc41bb4dff5bd74203e780d056525cc5a4b
  Author: Nicholas Bellinger <nab@linux-iscsi.org>
  Date:   Fri Jan 13 12:01:34 2012 -0800

      target: Add workaround for zero-length control CDB handling

So go ahead and change transport_generic_new_cmd() to handle control+data
zero-length CDBs in the same manner for this special case.

Tested with iscsi-target + loopback fabric port LUNs on 3.6-rc0 code.

This patch will also need to be picked up for 3.5-stable.

(hch: Add proper comment in transport_generic_new_cmd)

Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c