diff --git a/scst/README b/scst/README index 33490370a..d362ffd0f 100644 --- a/scst/README +++ b/scst/README @@ -1241,11 +1241,12 @@ As any other hardware, the local SCSI hardware can not handle commands with amount of data and/or segments count in scatter-gather array bigger some values. Therefore, when using the pass-through mode you should note that values for maximum number of segments and maximum amount of -transferred data for each SCSI command on devices on initiators can not -be bigger, than corresponding values of the corresponding SCSI devices -on the target. Otherwise you will see symptoms like small transfers work -well, but large ones stall and messages like: "Unable to complete -command due to SG IO count limitation" are printed in the kernel logs. +transferred data (max_sectors) for each SCSI command on devices on +initiators can not be bigger, than corresponding values of the +corresponding SCSI devices on the target. Otherwise you will see +symptoms like small transfers work well, but large ones stall and +messages like: "Unable to complete command due to SG IO count +limitation" are printed in the kernel logs. You can't control from the user space limit of the scatter-gather segments, but for block devices usually it is sufficient if you set on diff --git a/scst/README_in-tree b/scst/README_in-tree index 42daa7a91..333daa5cd 100644 --- a/scst/README_in-tree +++ b/scst/README_in-tree @@ -1094,11 +1094,12 @@ As any other hardware, the local SCSI hardware can not handle commands with amount of data and/or segments count in scatter-gather array bigger some values. Therefore, when using the pass-through mode you should note that values for maximum number of segments and maximum amount of -transferred data for each SCSI command on devices on initiators can not -be bigger, than corresponding values of the corresponding SCSI devices -on the target. Otherwise you will see symptoms like small transfers work -well, but large ones stall and messages like: "Unable to complete -command due to SG IO count limitation" are printed in the kernel logs. +transferred data (max_sectors) for each SCSI command on devices on +initiators can not be bigger, than corresponding values of the +corresponding SCSI devices on the target. Otherwise you will see +symptoms like small transfers work well, but large ones stall and +messages like: "Unable to complete command due to SG IO count +limitation" are printed in the kernel logs. You can't control from the user space limit of the scatter-gather segments, but for block devices usually it is sufficient if you set on diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 7076533a9..d40b8bccf 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2500,6 +2500,13 @@ static int scst_do_real_exec(struct scst_cmd *cmd) #endif if (unlikely(rc != 0)) { PRINT_ERROR("scst pass-through exec failed: %x", rc); + if ((int)rc == -EINVAL) + PRINT_ERROR("Do you have too low max_sectors on your " + "backend hardware? For success max_sectors must " + "be >= bufflen in sectors (max_sectors %d, " + "bufflen %db, CDB %x). See README for more " + "details.", dev->scsi_dev->host->max_sectors, + cmd->bufflen, cmd->cdb[0]); goto out_error; }