]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4cca082e68967ba2d63b90f840c9ed7313bd782c
treeda984f185900edca01b5f58829037db05757a1c9
parentcd595dd008a760db39903a26f65f8b10b123ddee
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