tcmu: Fix wrongly calculating of the base_command_size
authorXiubo Li <lixiubo@cmss.chinamobile.com>
Mon, 27 Mar 2017 09:07:41 +0000 (17:07 +0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 30 Mar 2017 08:36:53 +0000 (01:36 -0700)
commitabe342a5b4b5aa579f6bf40ba73447c699e6b579
treeda984f185900edca01b5f58829037db05757a1c9
parentab22d2604c86ceb01bb2725c9860b88a7dd383bb
tcmu: Fix wrongly calculating of the base_command_size

The t_data_nents and t_bidi_data_nents are the numbers of the
segments, but it couldn't be sure the block size equals to size
of the segment.

For the worst case, all the blocks are discontiguous and there
will need the same number of iovecs, that's to say: blocks == iovs.
So here just set the number of iovs to block count needed by tcmu
cmd.

Tested-by: Ilias Tsitsimpis <iliastsi@arrikto.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_user.c