]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
scsi: Fix data length == SCSI_SENSE_BUF_SIZE
authorChristian Hoff <christian.hoff@de.ibm.com>
Thu, 14 Jun 2012 13:55:25 +0000 (15:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Jul 2012 09:27:00 +0000 (11:27 +0200)
Fix the edge case where the sense data length is exactly the same
as SCSI_SENSE_BUF_SIZE.
This makes SCSI requests work that use all of the available 95 byte
sense data.

Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi-bus.c

index 14e2f730b827880b488f4ffc5ac9c1380b660686..4e95eee55b4195e9237e0b374edf7ed1a7266108 100644 (file)
@@ -1389,7 +1389,7 @@ void scsi_req_complete(SCSIRequest *req, int status)
     assert(req->status == -1);
     req->status = status;
 
-    assert(req->sense_len < sizeof(req->sense));
+    assert(req->sense_len <= sizeof(req->sense));
     if (status == GOOD) {
         req->sense_len = 0;
     }