From bd60cf55050361b52580fb4d6e51609ceb3515ce Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 26 Nov 2010 20:53:33 +0000 Subject: [PATCH] Minor improvement git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2843 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 6bcaea920..61adf4337 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2510,14 +2510,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 bufflen " - "must be <= max_sectors (bufflen %db, " - "max_sectors %d sectors, CDB %x). See README " - "for more details.", cmd->bufflen, + if (((int)rc == -EINVAL) && + (cmd->bufflen > queue_max_hw_sectors(scsi_dev->request_queue))) + PRINT_ERROR("Too low max_hw_sectors %d sectors on %s " + "to serve command %x with bufflen %db." + "See README for more details.", queue_max_hw_sectors(scsi_dev->request_queue), - cmd->cdb[0]); + dev->virt_name, cmd->cdb[0], cmd->bufflen); goto out_error; }