diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-06-13 14:31:12 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-06-13 14:31:12 -0400 |
commit | c282c68f89d3732f5d6eabca67814eecf7566a3c (patch) | |
tree | e775992e53405319d2f35c468f07d88bbc733cac | |
parent | 2dc51619991fdcda04157f372d3460288fb176d1 (diff) | |
download | longterm-queue-4.8-c282c68f89d3732f5d6eabca67814eecf7566a3c.tar.gz |
target: core: relocate patch block earlier in file
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch b/queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch index 1a2239e..1ade7aa 100644 --- a/queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch +++ b/queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch @@ -1,4 +1,4 @@ -From abe342a5b4b5aa579f6bf40ba73447c699e6b579 Mon Sep 17 00:00:00 2001 +From 63c2aad7aa7223982bffab0755d82ae2665c329a Mon Sep 17 00:00:00 2001 From: Xiubo Li <lixiubo@cmss.chinamobile.com> Date: Mon, 27 Mar 2017 17:07:41 +0800 Subject: [PATCH] tcmu: Fix wrongly calculating of the base_command_size @@ -19,13 +19,24 @@ 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> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c -index e58dfd4fe448..9885d1b521fe 100644 +index 2ffd4177feaa..d8083446ae5b 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c -@@ -408,6 +408,13 @@ static inline size_t tcmu_cmd_get_data_length(struct tcmu_cmd *tcmu_cmd) - return data_length; +@@ -429,8 +429,7 @@ static int tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd) + * expensive to tell how many regions are freed in the bitmap + */ + base_command_size = max(offsetof(struct tcmu_cmd_entry, +- req.iov[se_cmd->t_bidi_data_nents + +- se_cmd->t_data_nents]), ++ req.iov[tcmu_cmd_get_block_cnt(tcmu_cmd)]), + sizeof(struct tcmu_cmd_entry)); + command_size = base_command_size + + round_up(scsi_command_size(se_cmd->t_task_cdb), TCMU_OP_ALIGN_SIZE); +@@ -1138,6 +1137,13 @@ static sector_t tcmu_get_blocks(struct se_device *dev) + dev->dev_attrib.block_size); } +static inline uint32_t tcmu_cmd_get_block_cnt(struct tcmu_cmd *tcmu_cmd) @@ -36,18 +47,8 @@ index e58dfd4fe448..9885d1b521fe 100644 +} + static sense_reason_t - tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd) + tcmu_pass_op(struct se_cmd *se_cmd) { -@@ -435,8 +442,7 @@ tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd) - * expensive to tell how many regions are freed in the bitmap - */ - base_command_size = max(offsetof(struct tcmu_cmd_entry, -- req.iov[se_cmd->t_bidi_data_nents + -- se_cmd->t_data_nents]), -+ req.iov[tcmu_cmd_get_block_cnt(tcmu_cmd)]), - sizeof(struct tcmu_cmd_entry)); - command_size = base_command_size - + round_up(scsi_command_size(se_cmd->t_task_cdb), TCMU_OP_ALIGN_SIZE); -- 2.12.0 |