Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2437545imm; Thu, 2 Aug 2018 11:33:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdzTNV2VYs35vtl7iIqq5xjKFUQpJ4DLDqJjbwosRz40OGT83fs8oUgxtU70iCXdi7Ffera X-Received: by 2002:a63:8c0b:: with SMTP id m11-v6mr567794pgd.372.1533234819278; Thu, 02 Aug 2018 11:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533234819; cv=none; d=google.com; s=arc-20160816; b=UQZD9qEdYqgjnlv3TJAFI+nwywhZyZdZRI3CDT8vXx7DcbmaKsGEfMy7tk154rVt7p wfYMrHcBCxoN3rRLqVxGxfZzjyz0PrVqVz/NtWJsm2t7fhsxfaw6lr5g4Ofw76SxFL6B mIYqErJqimROXdNnsF36Ir4w5czs9xRtMWMmtNAKAc27h7lpVxe4Y2Y5FStE2AS0XF0R 02gm3v5kIehA7rYtxQpqgK2HJiAeHws3h2a6cQw0ohyPOkIeUnU3QQb8bihs5gRp6rh8 3Q6WU190oXXgxIuBtYOEJIQ9yzZrLlstgLStKjnKWl9oO4gQSn5FSs5Bx1ouTUzXo/XT kTMw== 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:arc-authentication-results; bh=BkrLSmEm759roii0RcaSxqNPRoSwNjbko9Usm3RpNwE=; b=CboF5XCTgJP5vhjdyHEbts2MhoYzCXjIU4t//6Dlk2ADb01NaStcYO7G/wO6O7FAGv 8b6wQkAn5YndNZ6/YLABnabQuyFax2jFIkxXdQ08XuYZMmNt75VZ92FLqpSo/B1XxI2+ nVOzuqUpvRdiUM/L8q/LnGT3nbroNhF9vMTc3wMjeV73IV2lav1lZrEjJem1FH7R8sz0 NdYiNqFOanZI0U8A9JHMxHV5xKatocNYoCMD7bKWgMd9tzwg1YoVGOxrIjjv2Rl7IF3t Wa30SYZqH5AGk/P4AsrB/2/UeObWYSPVipT7N9Mrdw3IZQXE9s+/jB7H6c0NVZ+89FfG 8VeQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 75-v6si2802625pgh.110.2018.08.02.11.33.23; Thu, 02 Aug 2018 11:33:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387672AbeHBTmZ (ORCPT + 99 others); Thu, 2 Aug 2018 15:42:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387422AbeHBTmZ (ORCPT ); Thu, 2 Aug 2018 15:42:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91313F2B29; Thu, 2 Aug 2018 17:50:14 +0000 (UTC) Received: from localhost (ovpn-12-120.pek2.redhat.com [10.72.12.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D7AE1C71F; Thu, 2 Aug 2018 17:50:01 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Ming Lei , Josef Bacik , Christoph Hellwig , Guenter Roeck , Mark Brown , Matt Hart , Johannes Thumshirn , John Garry , Hannes Reinecke , "Martin K. Petersen" , James Bottomley , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] blk-mq: fix blk_mq_tagset_busy_iter Date: Fri, 3 Aug 2018 01:49:37 +0800 Message-Id: <20180802174937.15444-3-ming.lei@redhat.com> In-Reply-To: <20180802174937.15444-1-ming.lei@redhat.com> References: <20180802174937.15444-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 02 Aug 2018 17:50:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 02 Aug 2018 17:50:14 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit d250bf4e776ff09d5("blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter") uses 'blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT' to replace 'blk_mq_request_started(req)', this way is wrong, and causes lots of test system hang during booting. Fix the issue by using blk_mq_request_started(req) inside bt_tags_iter(). Fixes: d250bf4e776ff09d5 ("blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter") Cc: Josef Bacik Cc: Christoph Hellwig Cc: Guenter Roeck Cc: Mark Brown Cc: Matt Hart Cc: Johannes Thumshirn Cc: John Garry Cc: Hannes Reinecke , Cc: "Martin K. Petersen" , Cc: James Bottomley Cc: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reported-by: Mark Brown Reported-by: Guenter Roeck Signed-off-by: Ming Lei --- block/blk-mq-tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 09b2ee6694fb..3de0836163c2 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -271,7 +271,7 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) * test and set the bit before assining ->rqs[]. */ rq = tags->rqs[bitnr]; - if (rq && blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) + if (rq && blk_mq_request_started(rq)) iter_data->fn(rq, iter_data->data, reserved); return true; -- 2.9.5