diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-01-06 19:10:37 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-01-09 18:21:40 -0500 |
commit | 046ba64285a4389ae5e9a7dfa253c6bff3d7c341 (patch) | |
tree | 8160b4c771df304f70cf7cfc155f6e7c152d0089 /drivers/target/target_core_file.c | |
parent | 67e51daa5029417db86f1833f1b7b2212c454fe9 (diff) |
target: Drop arbitrary maximum I/O size limit
This patch drops the arbitrary maximum I/O size limit in sbc_parse_cdb(),
which currently for fabric_max_sectors is hardcoded to 8192 (4 MB for 512
byte sector devices), and for hw_max_sectors is a backend driver dependent
value.
This limit is problematic because Linux initiators have only recently
started to honor block limits MAXIMUM TRANSFER LENGTH, and other non-Linux
based initiators (eg: MSFT Fibre Channel) can also generate I/Os larger
than 4 MB in size.
Currently when this happens, the following message will appear on the
target resulting in I/Os being returned with non recoverable status:
SCSI OP 28h with too big sectors 16384 exceeds fabric_max_sectors: 8192
Instead, drop both [fabric,hw]_max_sector checks in sbc_parse_cdb(),
and convert the existing hw_max_sectors into a purely informational
attribute used to represent the granuality that backend driver and/or
subsystem code is splitting I/Os upon.
Also, update FILEIO with an explicit FD_MAX_BYTES check in fd_execute_rw()
to deal with the one special iovec limitiation case.
v2 changes:
- Drop hw_max_sectors check in sbc_parse_cdb()
Reported-by: Lance Gropper <lance.gropper@qosserver.com>
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Roland Dreier <roland@purestorage.com>
Cc: stable@vger.kernel.org # 3.4
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r-- | drivers/target/target_core_file.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index c2aea099ea4a..b09021135c3b 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -621,7 +621,16 @@ fd_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, | |||
621 | struct fd_prot fd_prot; | 621 | struct fd_prot fd_prot; |
622 | sense_reason_t rc; | 622 | sense_reason_t rc; |
623 | int ret = 0; | 623 | int ret = 0; |
624 | 624 | /* | |
625 | * We are currently limited by the number of iovecs (2048) per | ||
626 | * single vfs_[writev,readv] call. | ||
627 | */ | ||
628 | if (cmd->data_length > FD_MAX_BYTES) { | ||
629 | pr_err("FILEIO: Not able to process I/O of %u bytes due to" | ||
630 | "FD_MAX_BYTES: %u iovec count limitiation\n", | ||
631 | cmd->data_length, FD_MAX_BYTES); | ||
632 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
633 | } | ||
625 | /* | 634 | /* |
626 | * Call vectorized fileio functions to map struct scatterlist | 635 | * Call vectorized fileio functions to map struct scatterlist |
627 | * physical memory addresses to struct iovec virtual memory. | 636 | * physical memory addresses to struct iovec virtual memory. |