diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch new file mode 100644 index 00000000..264206d6 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0060-target-Fix-range-calculation-in-WRITE-SAME-emulation.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 63a96e329f2c66af145a93d6f42067e54ef932af Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Dreier <roland@purestorage.com> | ||
3 | Date: Mon, 16 Jul 2012 17:10:17 -0700 | ||
4 | Subject: [PATCH 060/109] target: Fix range calculation in WRITE SAME | ||
5 | emulation when num blocks == 0 | ||
6 | |||
7 | commit 1765fe5edcb83f53fc67edeb559fcf4bc82c6460 upstream. | ||
8 | |||
9 | When NUMBER OF LOGICAL BLOCKS is 0, WRITE SAME is supposed to write | ||
10 | all the blocks from the specified LBA through the end of the device. | ||
11 | However, dev->transport->get_blocks(dev) (perhaps confusingly) returns | ||
12 | the last valid LBA rather than the number of blocks, so the correct | ||
13 | number of blocks to write starting with lba is | ||
14 | |||
15 | dev->transport->get_blocks(dev) - lba + 1 | ||
16 | |||
17 | (nab: Backport roland's for-3.6 patch to for-3.5) | ||
18 | |||
19 | Signed-off-by: Roland Dreier <roland@purestorage.com> | ||
20 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | drivers/target/target_core_cdb.c | 2 +- | ||
24 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
25 | |||
26 | diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c | ||
27 | index 65ea65a..93b9406 100644 | ||
28 | --- a/drivers/target/target_core_cdb.c | ||
29 | +++ b/drivers/target/target_core_cdb.c | ||
30 | @@ -1199,7 +1199,7 @@ int target_emulate_write_same(struct se_task *task) | ||
31 | if (num_blocks != 0) | ||
32 | range = num_blocks; | ||
33 | else | ||
34 | - range = (dev->transport->get_blocks(dev) - lba); | ||
35 | + range = (dev->transport->get_blocks(dev) - lba) + 1; | ||
36 | |||
37 | pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n", | ||
38 | (unsigned long long)lba, (unsigned long long)range); | ||
39 | -- | ||
40 | 1.7.7.6 | ||
41 | |||