From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592AbcGLIC3 (ORCPT ); Tue, 12 Jul 2016 04:02:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:48234 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbcGLIC1 (ORCPT ); Tue, 12 Jul 2016 04:02:27 -0400 Subject: Re: [PATCH v2] xen_pvscsi: reclaim the ring request when the prepairing failed To: Bin Wu , boris.ostrovsky@oracle.com, david.vrabel@citrix.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 References: <1468283787-18260-1-git-send-email-wu.wubin@huawei.com> From: Juergen Gross Message-ID: <5784A40F.9000908@suse.com> Date: Tue, 12 Jul 2016 10:02:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1468283787-18260-1-git-send-email-wu.wubin@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07/16 02:36, Bin Wu wrote: > 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 Reviewed-by: Juergen Gross > --- > 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); >