From patchwork Mon Jun 4 09:03:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jianchao.wang" X-Patchwork-Id: 10446123 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 0D61560375 for ; Mon, 4 Jun 2018 09:03:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2EF128B9D for ; Mon, 4 Jun 2018 09:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E791B28BAE; Mon, 4 Jun 2018 09:03:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 8C28E28B9D for ; Mon, 4 Jun 2018 09:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbeFDJDS (ORCPT ); Mon, 4 Jun 2018 05:03:18 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:46538 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbeFDJDR (ORCPT ); Mon, 4 Jun 2018 05:03:17 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5490Ufx143936; Mon, 4 Jun 2018 09:03:03 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=5UWZDNmCU7KlowXwS/5pzx+AXirYeWyoklngChiqdTU=; b=BxNuLKv91Z+MfLI1+4218P0nUNVCUKWIoIhLWayiqPg+7G1o+5u9OP5TMtyln2oRLMiy stfQuCtsCGm+88wm21DPPQd/iTaRHsaRbs+7YGmTSyNAYCngNCwcOOhmjhemkps+Fkjl Qh5WdZX2ZwGJ8GBsTywG7YAHdfLu8BzXi6uCnQKEG2/7efOARrbGFAv3lmxLlEBn9Fy/ pCu/zlUnGgDLa7hXEfrz0feN/8LoJ1T7MnTkkuxMKoA48NdxXOPoN747wCMfQpqYlVcV vopqa0AHsbts7Aw6AVIKZEuvk+aJFNyprjHAwAe49WP2SokKRGWLsCzeIFTkm12Gq4It eg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2jbvypam5y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jun 2018 09:03:03 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w54932ic009855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Jun 2018 09:03:02 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w54931eB002898; Mon, 4 Jun 2018 09:03:01 GMT Received: from will-ThinkCentre-M910s.cn.oracle.com (/10.182.70.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 Jun 2018 02:03:01 -0700 From: Jianchao Wang To: axboe@kernel.dk, ming.lei@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] blk-mq: return when BLK_MQ_S_STOPPED in blk_mq_run_work_fn Date: Mon, 4 Jun 2018 17:03:55 +0800 Message-Id: <1528103035-8009-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=8913 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=880 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806040113 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP if hctx is stopped, don't run the queue in blk_mq_run_work_fn. Fixes: 15fe8a9 (blk-mq: remove blk_mq_delay_queue()) Cc: Ming Lei Signed-off-by: Jianchao Wang Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 9ce9cac..d0ee928 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1578,7 +1578,7 @@ static void blk_mq_run_work_fn(struct work_struct *work) * If we are stopped, don't run the queue. */ if (test_bit(BLK_MQ_S_STOPPED, &hctx->state)) - clear_bit(BLK_MQ_S_STOPPED, &hctx->state); + return; __blk_mq_run_hw_queue(hctx); }