xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Bin Wu <wu.wubin@huawei.com>
To: boris.ostrovsky@oracle.com, david.vrabel@citrix.com,
	jgross@suse.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com, xen-devel@lists.xenproject.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	wu.wubin@huawei.com
Subject: [PATCH v2] xen_pvscsi: reclaim the ring request when the prepairing failed
Date: Tue, 12 Jul 2016 08:36:27 +0800	[thread overview]
Message-ID: <1468283787-18260-1-git-send-email-wu.wubin__19927.4094113663$1468283992$gmane$org@huawei.com> (raw)

During scsi command queueing or exception handling, if prepairing
fails, we need to reclaim the failed request. Otherwise, the garbage
request will be pushed into the ring for the backend to work.

Signed-off-by: Bin Wu <wu.wubin@huawei.com>
---
 drivers/scsi/xen-scsifront.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 9dc8687..8646db1 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -184,8 +184,6 @@ static struct vscsiif_request *scsifront_pre_req(struct vscsifrnt_info *info)
 
 	ring_req = RING_GET_REQUEST(&(info->ring), ring->req_prod_pvt);
 
-	ring->req_prod_pvt++;
-
 	ring_req->rqid = (uint16_t)id;
 
 	return ring_req;
@@ -196,6 +194,8 @@ static void scsifront_do_request(struct vscsifrnt_info *info)
 	struct vscsiif_front_ring *ring = &(info->ring);
 	int notify;
 
+	ring->req_prod_pvt++;
+
 	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(ring, notify);
 	if (notify)
 		notify_remote_via_irq(info->irq);
-- 
2.3.2 (Apple Git-55)



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

             reply	other threads:[~2016-07-12  0:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  0:36 Bin Wu [this message]
     [not found] <1468283787-18260-1-git-send-email-wu.wubin@huawei.com>
2016-07-12  8:02 ` [PATCH v2] xen_pvscsi: reclaim the ring request when the prepairing failed Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='1468283787-18260-1-git-send-email-wu.wubin__19927.4094113663$1468283992$gmane$org@huawei.com' \
    --to=wu.wubin@huawei.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).