Patchwork [v3,20/21] scsi-generic: Handle queue full

login
register
mail settings
Submitter Paolo Bonzini
Date May 17, 2011, 11:01 a.m.
Message ID <1305630067-2119-21-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/95924/
State New
Headers show

Comments

Paolo Bonzini - May 17, 2011, 11:01 a.m.
The sg driver currently has a hardcoded limit of commands it
can handle simultaneously. When this limit is reached the
driver will return -EDOM. So we need to capture this to
enable proper return values here.

Signed-off-by: Hannes Reinecke <hare@suse.de>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi-generic.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Christoph Hellwig - May 20, 2011, 4:09 p.m.
Looks good,


Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch

diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 1ea0930..0c04606 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -124,6 +124,9 @@  static void scsi_command_complete(void *opaque, int ret)
 
     if (ret != 0) {
         switch (ret) {
+        case -EDOM:
+            r->req.status = TASK_SET_FULL;
+            break;
         case -EINVAL:
             r->req.status = CHECK_CONDITION;
             scsi_set_sense(s, SENSE_CODE(INVALID_FIELD));