target: Fix WRITE_SAME usage with transport_get_size
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 9 Aug 2011 02:08:23 +0000 (19:08 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 22 Aug 2011 19:26:22 +0000 (19:26 +0000)
commit12850626e2717f866a94e6ced724e3efe5a0aab8
tree9585f7c65f46167d5af355f49faaa49639683bf4
parent706d5860969b3b24d65d9a57bd3bb5e4a1419c08
target: Fix WRITE_SAME usage with transport_get_size

For all flavours of WRITE_SAME, we only expect to handle a single block
of data-out buffer payload, regardless of the number of logical blocks
presented in the CDB.  This patch changes all flavours of WRITE_SAME in
transport_generic_cmd_sequencer() to pass '1' into transport_get_size()
instead of the extracted 'sectors' to properly handle the default usage
of sg_write_same without the --xferlen parameter.

Reported-by: Eric Seppanen <eric@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
drivers/target/target_core_transport.c