Received: by 10.223.185.116 with SMTP id b49csp3469770wrg; Sun, 25 Feb 2018 23:59:34 -0800 (PST) X-Google-Smtp-Source: AH8x225dztikJIy2zxpmtLNxQLsKNkiPXdwhq+juajhjXPirHNHVcuJWTbMGSEk6XC+pXjQCdHCG X-Received: by 10.98.217.211 with SMTP id b80mr9883428pfl.107.1519631974565; Sun, 25 Feb 2018 23:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519631974; cv=none; d=google.com; s=arc-20160816; b=bKe71mM9O1jHX3/qXu1JM2tcBNbukIadcPfwKQnrEfvSyc49FYefdyIMb4DAlDDOnQ 9WfFMI/PN1mi/maJl5CS4ZrSN/3GUPXw2IXu4OOuSuJHWbl02B2eeD8/u+yv0WYDOosZ SrFQwKXqjQ7dgVHFWDOePJjJyHdO7xvTRxDouI2bb6XTubz7znUylCpwPPNLxbl8wRps gPzokyqe5FeIBL76VOsHsZpPkwj5D1lNynZjawkcK0dbIdY9CXGP7TbmBezfUC/Mzjuc 1+sshAcN7NBxD86t6AWHxZ9X/79gX0JvGgOg7rQUb+MWhcCTwhKZyejJu/UIVBjpnUxA ACVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=FcOjc24lABFIFa0JSBpS7zZkY1+sNi0HzJUnExgLrVU=; b=f91fBcVR1SV746A1BDlMzHL2hoNvEyf2m7nC9587vXkzt36ddaxCY+ng3C1H1B7OCq SyfRs14ObPSXPpevjnQuIVLMQNDOAPAe2soKKngw0HyO/+EOEPGOOAqu+fd/DjYFrwpI nQERsCs6+PofXaO+eGDfokcBjUczBEZMmhayqp1YxelKIB8JBT6xqbZPhIM7ofq8f+BQ HeYcP7Od5PW+dNxU+tSvDvLUlfUitkPyLazNKnCnwip/f5L0CH7iNfoWkoRSNfsUmLgy 89c0UOpxPzpoFkBFbTF3xvv9zUlUqzHbBwPlK7jb4N9JMh2ZvHYy0tMrNWvLX4JQk1nW cOtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PxsLRRIK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si6376876pfi.344.2018.02.25.23.59.20; Sun, 25 Feb 2018 23:59:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PxsLRRIK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752118AbeBZH6m (ORCPT + 99 others); Mon, 26 Feb 2018 02:58:42 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:52034 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbeBZH6k (ORCPT ); Mon, 26 Feb 2018 02:58:40 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1Q7vTGu105452; Mon, 26 Feb 2018 07:58:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=FcOjc24lABFIFa0JSBpS7zZkY1+sNi0HzJUnExgLrVU=; b=PxsLRRIKdOppZF6dDhf71f/+v5PgBr2QjGIAGjwykXpvWQfJOepi9fqFjdyVrhhGB46+ cBqdz51cNvn7cUSQxapyxuyimp4JAJFVSJTvFsykexDJXX8u8boW5EFH3v1P4vMjAnzy 4Ua8qlphsSX6mtUMdNfPE6j8qNa9pNpgtI2++bKlSYkUg0yzvUUFR+zSozg2M8IT5EEc o9BoH9VROSvnT6KIH2IOqfelYM/cfltMXOraoCEp04zrMe7RSDBayH9UEDJwWLiM50F+ +ciu2gb+VQeKlVWV8KZWGQfqpgVVbYx4cp8H7M5OMQvDuKFe0ScaBovQ5P51ids/geR1 FQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2gcdywr2e7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2018 07:58:35 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1Q7wYdl011329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Feb 2018 07:58:34 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1Q7wXKt026387; Mon, 26 Feb 2018 07:58:34 GMT Received: from will-ThinkCentre-M910s.cn.oracle.com (/10.182.70.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 25 Feb 2018 23:58:33 -0800 From: Jianchao Wang To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert Date: Mon, 26 Feb 2018 15:58:52 +0800 Message-Id: <1519631932-1730-1-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8815 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802260109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In scsi core, __scsi_queue_insert should just put request back on the queue and retry using the same command as before. However, for blk-mq, scsi_mq_requeue_cmd is employed here which will unprepare the request. To align with the semantics of __scsi_queue_insert, just use blk_mq_requeue_request with kick_requeue_list == true. Cc: Christoph Hellwig Signed-off-by: Jianchao Wang --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a86df9c..06d8110 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -191,7 +191,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy) */ cmd->result = 0; if (q->mq_ops) { - scsi_mq_requeue_cmd(cmd); + blk_mq_requeue_request(cmd->request, true); return; } spin_lock_irqsave(q->queue_lock, flags); -- 2.7.4