Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp258495ima; Fri, 15 Mar 2019 02:07:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+q6cRriivqCoyo68iddnK1t7EmEtovL2fyHUoc4KsHZVnsn5LR19lhM7b6QNRf1IxV+Q/ X-Received: by 2002:a17:902:e60e:: with SMTP id cm14mr3081170plb.192.1552640855394; Fri, 15 Mar 2019 02:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552640855; cv=none; d=google.com; s=arc-20160816; b=0LrQnl/ARkriL3Wg+kJEZ9rUQMeyg9+iYJW2JnuX5JvDuBYzH6jT2U6ZRhB7sZV1V2 D39WX/NBk3V0WN9g45bcB0oeOyMUGtjMUlFc/gTPWxvS5itNFL8Cs4tVM3mpEqem/BWA cIaCA5NalHmToECRSLIiVi0mWgWGqdpUnIs7ORO4kp7SIbk8YrkKwdFku53co/gMSYBq vRPVVdFuxj2WWihiNZeAvrppSBqFpScM4yWpuYVTpfW5huxBKGiCv5Fp85pwd31ommyY 3jPsd8Xcf5dJhkIymyMf/OQNfV4Unx5bSZbraFe2liQs0/I19r/v8LwHosKrfoDXPZxt WBaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3fE6qdcH4Ccpw7H6cCg51Qtvf/v1uSWjMXLedQ7vr3Q=; b=dQVcKbUmCNjZjOg+EdeQVU9hsjachQJ2aln5T9Q/RhXeOWHqwRgst64QElDqZBxj+S ojSvpZwCXMUlh20g9NQnZ3Nx8+b958CT8pUTqV14brC5s4rC5Ujd0x3wghFekOuqK9Sa ZzGJnAm4uWxbWnx98Pm1Ja5MntsRRaB0gDnkSF5R8oa8v7SMpSTvyBEcSwvtzaGEd61a IE3OH0jQTKGqsYv6nsq+udK2yDj8jjlOxBvXSEFFBDiJMxo/nATbVuVxJzsmdVYvgxqw PHIkY+OQ4fUdE6atw9sWU9Aar2/dFbJrayXHR0VNMDr1oD2u11dCadymwZSnzgd2idgY tB9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Kzesn5fH; 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 d9si1365883pln.403.2019.03.15.02.07.20; Fri, 15 Mar 2019 02:07:35 -0700 (PDT) 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-2018-07-02 header.b=Kzesn5fH; 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 S1728630AbfCOJGo (ORCPT + 99 others); Fri, 15 Mar 2019 05:06:44 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40616 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727470AbfCOJGn (ORCPT ); Fri, 15 Mar 2019 05:06:43 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2F8xI5J027981; Fri, 15 Mar 2019 09:06:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=3fE6qdcH4Ccpw7H6cCg51Qtvf/v1uSWjMXLedQ7vr3Q=; b=Kzesn5fHkKDXfgXY2nsAsO/mT2PR7yZ3KBhaIASyr3oDt81pjiCLWn767XJPY2641ecm XGv2Hrh6rmodqfBqDU6AOU8WJMLhDPz2c8FmLLg92CRt6uR6g+oX4808KzXvA/9JWGg7 Cq+FKKiZfH40pjKEDk3zOdjh0hRaCYL7f8W8ZsesIJkxV2s1AaF2I5T2BYQhIln9KncU MgRZ9jYBgxu0/9XGlw8LQ9lZ+CBnGowApHCCqwWGrB0pyTcpefgamU5LrAXmvJv63J9S AMCThMbivyreEy8NHrIn+zuwsM2/ky6m4EAnB6xFzb5ptKpYWYhdA0NRRDNCsLzSujdu ng== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2r464rwhtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Mar 2019 09:06:30 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2F96OEc005837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Mar 2019 09:06:24 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2F96OHK017621; Fri, 15 Mar 2019 09:06:24 GMT Received: from will-ThinkCentre-M93p.cn.oracle.com (/10.182.71.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Mar 2019 09:06:24 +0000 From: Jianchao Wang To: axboe@kernel.dk Cc: hch@lst.de, jthumshirn@suse.de, hare@suse.de, josef@toxicpanda.com, bvanassche@acm.org, sagi@grimberg.me, keith.busch@intel.com, jsmart2021@gmail.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] nbd: use blk_mq_queue_tag_busy_iter Date: Fri, 15 Mar 2019 16:57:41 +0800 Message-Id: <1552640264-26101-6-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> References: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9195 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=857 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903150067 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org blk_mq_tagset_busy_iter is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_busy_iter here. Signed-off-by: Jianchao Wang --- drivers/block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7c9a949..9e7e828 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -747,7 +747,7 @@ static bool nbd_clear_req(struct request *req, void *data, bool reserved) static void nbd_clear_que(struct nbd_device *nbd) { blk_mq_quiesce_queue(nbd->disk->queue); - blk_mq_tagset_busy_iter(&nbd->tag_set, nbd_clear_req, NULL); + blk_mq_queue_tag_busy_iter(nbd->disk->queue, nbd_clear_req, NULL, true); blk_mq_unquiesce_queue(nbd->disk->queue); dev_dbg(disk_to_dev(nbd->disk), "queue cleared\n"); } -- 2.7.4