diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-12 20:24:11 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 20:25:09 (GMT) |
commit | cd3f6dea647f4d5e49f44ae919966e18b0e63ac7 (patch) | |
tree | 928b88635e4c3a55ef2f74d04ab0ad83d597bd37 /drivers/target/target_core_device.c | |
parent | a7a50a853cbba22cafec1e1c618ccf9919986fca (diff) | |
download | linux-fsl-qoriq-cd3f6dea647f4d5e49f44ae919966e18b0e63ac7.tar.xz |
target/file: Update hw_max_sectors based on current block_size
commit 95cadace8f3959282e76ebf8b382bd0930807d2c upstream.
This patch allows FILEIO to update hw_max_sectors based on the current
max_bytes_per_io. This is required because vfs_[writev,readv]() can accept
a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really
needs to be calculated based on block_size.
This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M
sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for
the block_size=4096 case.
(v2: Use max_bytes_per_io instead of ->update_hw_max_sectors)
Reported-by: Henrik Goldman <hg@x-formation.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r-- | drivers/target/target_core_device.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index d90dbb0..e5e3965 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -1107,6 +1107,11 @@ int se_dev_set_block_size(struct se_device *dev, u32 block_size) dev->dev_attrib.block_size = block_size; pr_debug("dev[%p]: SE Device block_size changed to %u\n", dev, block_size); + + if (dev->dev_attrib.max_bytes_per_io) + dev->dev_attrib.hw_max_sectors = + dev->dev_attrib.max_bytes_per_io / block_size; + return 0; } |