From patchwork Mon Jul 11 02:51:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Wu X-Patchwork-Id: 9222833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3585A604DB for ; Mon, 11 Jul 2016 02:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294DF26E8A for ; Mon, 11 Jul 2016 02:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DFE92793D; Mon, 11 Jul 2016 02:53:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF1E26E8A for ; Mon, 11 Jul 2016 02:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757523AbcGKCxT (ORCPT ); Sun, 10 Jul 2016 22:53:19 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:11766 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757265AbcGKCxT (ORCPT ); Sun, 10 Jul 2016 22:53:19 -0400 Received: from 172.24.1.47 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CEO52659; Mon, 11 Jul 2016 10:52:26 +0800 (CST) Received: from [127.0.0.1] (10.177.24.77) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Mon, 11 Jul 2016 10:52:17 +0800 To: , , , , , , , , From: Bin Wu Subject: [PATCH] xen_pvscsi: reclaim the ring request when mapping data failed Message-ID: <578309AE.1080704@huawei.com> Date: Mon, 11 Jul 2016 10:51:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 X-Originating-IP: [10.177.24.77] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.578309EE.005B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 819c37a3f5e3ebcd111deb4658397e74 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During scsi command queueing, if mapping data 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 --- drivers/scsi/xen-scsifront.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 9dc8687..655163d 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -565,6 +565,7 @@ static int scsifront_queuecommand(struct Scsi_Host *shost, err = map_data_for_request(info, sc, ring_req, shadow); if (err < 0) { pr_debug("%s: err %d\n", __func__, err); + info->ring.req_prod_pvt--; scsifront_put_rqid(info, rqid); scsifront_return(info); spin_unlock_irqrestore(shost->host_lock, flags);