summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2013-11-21 17:58:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-13 13:55:32 -0800
commita4adb08e9e9f157221c94678b4ca7dae4b476c34 (patch)
tree4b830f7344f03319c33a70a0a72a8aeeed273cf3 /include
parent76a2ca6041fdfd0103d3db6af2f7371bdfb2ac27 (diff)
downloadlinux-stable-a4adb08e9e9f157221c94678b4ca7dae4b476c34.tar.gz
linux-stable-a4adb08e9e9f157221c94678b4ca7dae4b476c34.tar.bz2
linux-stable-a4adb08e9e9f157221c94678b4ca7dae4b476c34.zip
ore: Fix wrong math in allocation of per device BIO
commit aad560b7f63b495f48a7232fd086c5913a676e6f upstream. At IO preparation we calculate the max pages at each device and allocate a BIO per device of that size. The calculation was wrong on some unaligned corner cases offset/length combination and would make prepare return with -ENOMEM. This would be bad for pnfs-objects that would in that case IO through MDS. And fatal for exofs were it would fail writes with EIO. Fix it by doing the proper math, that will work in all cases. (I ran a test with all possible offset/length combinations this time round). Also when reading we do not need to allocate for the parity units since we jump over them. Also lower the max_io_length to take into account the parity pages so not to allocate BIOs bigger than PAGE_SIZE Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/osd_ore.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index a5f9b960dfc8..6ca3265a4dca 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -102,6 +102,7 @@ struct ore_striping_info {
unsigned unit_off;
unsigned cur_pg;
unsigned cur_comp;
+ unsigned maxdevUnits;
};
struct ore_io_state;