summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2017-06-22 10:49:21 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2017-06-22 10:49:21 -0400
commitdcfb6cc2875e74656fbc1b58cf91c52fe893b49e (patch)
tree96cf601e5d19f7368f94700a78089c7121bd7f3c
parent0b69b7ab4e444a78c8538a46ed3b7b21853e220b (diff)
downloadlongterm-queue-4.8-dcfb6cc2875e74656fbc1b58cf91c52fe893b49e.tar.gz
tcmu: fix chunk ordering in patch
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--queue/tcmu-Fix-wrongly-calculating-of-the-base_command_siz.patch32
1 files changed, 16 insertions, 16 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 1ade7aa..6a54af9 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 63c2aad7aa7223982bffab0755d82ae2665c329a Mon Sep 17 00:00:00 2001
+From 12c12283cd048760cd81cb828ed2c920149e32f8 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
@@ -22,21 +22,11 @@ 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 2ffd4177feaa..d8083446ae5b 100644
+index 2ffd4177feaa..48e29a2ed326 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
-@@ -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);
+@@ -403,6 +403,13 @@ static inline size_t tcmu_cmd_get_data_length(struct tcmu_cmd *tcmu_cmd)
+ return data_length;
}
+static inline uint32_t tcmu_cmd_get_block_cnt(struct tcmu_cmd *tcmu_cmd)
@@ -46,9 +36,19 @@ index 2ffd4177feaa..d8083446ae5b 100644
+ return data_length / DATA_BLOCK_SIZE;
+}
+
- static sense_reason_t
- tcmu_pass_op(struct se_cmd *se_cmd)
+ static int tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)
{
+ struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
+@@ -429,8 +436,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);
--
2.12.0