From patchwork Fri Jan 12 21:52:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10161757 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 CB9DB60327 for ; Fri, 12 Jan 2018 21:52:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD0C228A5B for ; Fri, 12 Jan 2018 21:52:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B082A28A60; Fri, 12 Jan 2018 21:52:10 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 E375728A5B for ; Fri, 12 Jan 2018 21:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965189AbeALVwJ (ORCPT ); Fri, 12 Jan 2018 16:52:09 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:26579 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965133AbeALVwI (ORCPT ); Fri, 12 Jan 2018 16:52:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1515793928; x=1547329928; h=from:to:cc:subject:date:message-id; bh=5R7BJYiQJmTtTxCQg/9pBVJHTHhrVsj7PqyU9Y+Vm+k=; b=DvgPGnnSVTLsVpSDVeIeQs/SrgQl5FZ5bIKpaAGyCzCU3X8FTm+hXZMg HxtWc2L+m1N3c2tOStXE5wpQbFJLGXHcoiAdeMjJwEQA/scXrjkwbgHGp 5JFN7p2Rpih8Fur2X1WBk0T6Q2iQD97PiPHN606ArKxZcdNO3vnNzD04V 5WbFnBLhX3ACUqFGgGHcw8FzGXXNSXgj+RLeWfoOy7fMu9blMxdEr7Ua0 zdfxGni2Nmao+LUxED421Vw/z2t6Z9Vuz2lhBUFJLgiqRQehWttQG/Bc5 hKESqrY4VhSGQCj6MiHo9FgeWjIr/N1gVanXoSpngkY5FCpRePddagLT6 g==; X-IronPort-AV: E=Sophos;i="5.46,350,1511798400"; d="scan'208";a="69095944" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 13 Jan 2018 05:52:08 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 12 Jan 2018 13:47:36 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 12 Jan 2018 13:52:08 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Ming Lei , Hannes Reinecke , Johannes Thumshirn , "Martin K . Petersen" Subject: [PATCH] blk-mq-debugfs: Also show requests that have not yet been started Date: Fri, 12 Jan 2018 13:52:07 -0800 Message-Id: <20180112215207.17852-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.1 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 When debugging e.g. the SCSI timeout handler it is important that requests that have not yet been started or that already have completed are also reported through debugfs. This patch depends on a patch that went upstream recently, namely commit 14e3062fb185 ("scsi: core: Fix a scsi_show_rq() NULL pointer dereference"). Signed-off-by: Bart Van Assche Cc: Ming Lei Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Martin K. Petersen --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 19db3f583bf1..ccd5ef08c3f0 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -402,7 +402,7 @@ static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved) const struct show_busy_params *params = data; if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx && - blk_mq_rq_state(rq) != MQ_RQ_IDLE) + list_empty(&rq->queuelist)) __blk_mq_debugfs_rq_show(params->m, list_entry_rq(&rq->queuelist)); }