WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] [PVSCSI] Fix sense_len

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] [PVSCSI] Fix sense_len
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 09 Dec 2008 08:40:14 -0800
Delivery-date: Tue, 09 Dec 2008 08:40:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228827740 0
# Node ID 3669e92f24cd82bc4b5a03b199f90465558123f6
# Parent  82ce2e69bb5b513fd6b307de40606e053e0920b0
[PVSCSI] Fix sense_len

Signed-off-by: James Harper <james.harper@xxxxxxxxxxxxxxxx>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>
Signed-off-by: Jun Kamada <kama@xxxxxxxxxxxxxx>
---
 drivers/xen/scsiback/scsiback.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff -r 82ce2e69bb5b -r 3669e92f24cd drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c   Tue Dec 09 13:02:02 2008 +0000
+++ b/drivers/xen/scsiback/scsiback.c   Tue Dec 09 13:02:20 2008 +0000
@@ -148,6 +148,7 @@ void scsiback_do_resp_with_sense(char *s
        struct vscsibk_info *info = pending_req->info;
        int notify;
        int more_to_do = 1;
+       struct scsi_sense_hdr sshdr;
        unsigned long flags;
 
        DPRINTK("%s\n",__FUNCTION__);
@@ -161,9 +162,17 @@ void scsiback_do_resp_with_sense(char *s
        ring_res->rqid   = pending_req->rqid;
 
        if (sense_buffer != NULL) {
-               memcpy(ring_res->sense_buffer, sense_buffer,
-                               VSCSIIF_SENSE_BUFFERSIZE);
-               ring_res->sense_len = VSCSIIF_SENSE_BUFFERSIZE;
+               if (scsi_normalize_sense(sense_buffer,
+                       sizeof(sense_buffer), &sshdr)) {
+
+                       int len = 8 + sense_buffer[7];
+
+                       if (len > VSCSIIF_SENSE_BUFFERSIZE)
+                               len = VSCSIIF_SENSE_BUFFERSIZE;
+
+                       memcpy(ring_res->sense_buffer, sense_buffer, len);
+                       ring_res->sense_len = len;
+               }
        } else {
                ring_res->sense_len = 0;
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] [PVSCSI] Fix sense_len, Xen patchbot-linux-2.6.18-xen <=