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: add retry in REPORT_LUN emula

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] pvscsi: add retry in REPORT_LUN emulation
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jul 2008 08:50:48 -0700
Delivery-date: Wed, 23 Jul 2008 08:52:49 -0700
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 1216803464 -3600
# Node ID 3bcc901cbd7a45c96520b6a99d483a349169cbd4
# Parent  8a3dc4fdb4785447398e983c22241c38f128663b
pvscsi: add retry in REPORT_LUN emulation

Signed-off-by: Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>
Signed-off-by: Jun Kamada <kama@xxxxxxxxxxxxxx>
---
 drivers/xen/scsiback/emulate.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff -r 8a3dc4fdb478 -r 3bcc901cbd7a drivers/xen/scsiback/emulate.c
--- a/drivers/xen/scsiback/emulate.c    Tue Jul 22 11:59:42 2008 +0100
+++ b/drivers/xen/scsiback/emulate.c    Wed Jul 23 09:57:44 2008 +0100
@@ -73,8 +73,6 @@
 #define VSCSI_MAX_SCSI_OP_CODE         256
 static unsigned char bitmap[VSCSI_MAX_SCSI_OP_CODE];
 
-/* REPORT LUNS Header*/
-#define VSCSI_REPORT_LUNS_HEADER       8
 
 
 /*
@@ -200,6 +198,11 @@ static int __nr_luns_under_host(struct v
 
        return (lun_cnt);
 }
+
+
+/* REPORT LUNS Define*/
+#define VSCSI_REPORT_LUNS_HEADER       8
+#define VSCSI_REPORT_LUNS_RETRY                3
 
 /* quoted scsi_debug.c/resp_report_luns() */
 static void __report_luns(pending_req_t *pending_req, void *data)
@@ -215,6 +218,7 @@ static void __report_luns(pending_req_t 
        unsigned int alloc_luns = 0;
        unsigned int req_bufflen = 0;
        unsigned int actual_len = 0;
+       unsigned int retry_cnt = 0;
        int select_report = (int)cmd[2];
        int i, lun_cnt = 0, lun, upper, err = 0;
        
@@ -231,7 +235,7 @@ static void __report_luns(pending_req_t 
        alloc_luns = __nr_luns_under_host(info);
        alloc_len  = sizeof(struct scsi_lun) * alloc_luns
                                + VSCSI_REPORT_LUNS_HEADER;
-
+retry:
        if ((buff = kmalloc(alloc_len, GFP_KERNEL)) == NULL) {
                printk(KERN_ERR "scsiback:%s kmalloc err\n", __FUNCTION__);
                goto fail;
@@ -246,8 +250,19 @@ static void __report_luns(pending_req_t 
                    (entry->v.tgt == target)) {
                        
                        /* check overflow */
-                       if (lun_cnt >= alloc_luns)
+                       if (lun_cnt >= alloc_luns) {
+                               spin_unlock_irqrestore(&info->v2p_lock,
+                                                       flags);
+
+                               if (retry_cnt < VSCSI_REPORT_LUNS_RETRY) {
+                                       retry_cnt++;
+                                       if (buff)
+                                               kfree(buff);
+                                       goto retry;
+                               }
+
                                goto fail;
+                       }
 
                        lun = entry->v.lun;
                        upper = (lun >> 8) & 0x3f;

_______________________________________________
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: add retry in REPORT_LUN emulation, Xen patchbot-linux-2.6.18-xen <=