summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch
new file mode 100644
index 00000000..0102742c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0042-target-Fix-reading-of-data-length-fields-for-UNMAP-c.patch
@@ -0,0 +1,51 @@
1From b31df389ada54f5b2725826cd8d9a13ace960168 Mon Sep 17 00:00:00 2001
2From: Roland Dreier <roland@purestorage.com>
3Date: Mon, 16 Jul 2012 15:34:23 -0700
4Subject: [PATCH 42/73] target: Fix reading of data length fields for UNMAP
5 commands
6
7commit 1a5fa4576ec8a462313c7516b31d7453481ddbe8 upstream.
8
9The UNMAP DATA LENGTH and UNMAP BLOCK DESCRIPTOR DATA LENGTH fields
10are in the unmap descriptor (the payload transferred to our data out
11buffer), not in the CDB itself. Read them from the correct place in
12target_emulated_unmap.
13
14Signed-off-by: Roland Dreier <roland@purestorage.com>
15Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
16[bwh: Backported to 3.2: adjust filename, context]
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/target/target_core_cdb.c | 6 +++---
20 1 files changed, 3 insertions(+), 3 deletions(-)
21
22diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
23index 45a3ed4..b1f5cf0 100644
24--- a/drivers/target/target_core_cdb.c
25+++ b/drivers/target/target_core_cdb.c
26@@ -1114,7 +1114,6 @@ int target_emulate_unmap(struct se_task *task)
27 struct se_cmd *cmd = task->task_se_cmd;
28 struct se_device *dev = cmd->se_dev;
29 unsigned char *buf, *ptr = NULL;
30- unsigned char *cdb = &cmd->t_task_cdb[0];
31 sector_t lba;
32 unsigned int size = cmd->data_length, range;
33 int ret = 0, offset;
34@@ -1130,11 +1129,12 @@ int target_emulate_unmap(struct se_task *task)
35 /* First UNMAP block descriptor starts at 8 byte offset */
36 offset = 8;
37 size -= 8;
38- dl = get_unaligned_be16(&cdb[0]);
39- bd_dl = get_unaligned_be16(&cdb[2]);
40
41 buf = transport_kmap_data_sg(cmd);
42
43+ dl = get_unaligned_be16(&buf[0]);
44+ bd_dl = get_unaligned_be16(&buf[2]);
45+
46 ptr = &buf[offset];
47 pr_debug("UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu"
48 " ptr: %p\n", dev->transport->name, dl, bd_dl, size, ptr);
49--
501.7.7.6
51