From patchwork Tue Oct 3 21:57:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9983569 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 84D0260375 for ; Tue, 3 Oct 2017 21:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1492766D for ; Tue, 3 Oct 2017 21:57:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FDF528994; Tue, 3 Oct 2017 21:57:28 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 F07CE2766D for ; Tue, 3 Oct 2017 21:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486AbdJCV51 (ORCPT ); Tue, 3 Oct 2017 17:57:27 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:43527 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdJCV50 (ORCPT ); Tue, 3 Oct 2017 17:57:26 -0400 Received: by mail-pf0-f174.google.com with SMTP id d2so2064048pfh.0 for ; Tue, 03 Oct 2017 14:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=iu+Zs5UGk+Sw1e/hp2BPMAgVOEPgR57kVRlii9EgTog=; b=p7lEKiBklmz2HSjAbiWhZCYqhp3oMSWinI9Z6at+064P7/iODmDEl2SRC8vZ18nPcr SR7MPaJ/6iFIIn5wpR+QNLUQa4Rmztb9OMR7tHPzSwbS7VjKnrWDxSUMpdfoT2V6JgRZ P7WbN7WVtgM3hHwdy60nBdfpw1WrTsjtKWGq14KkXvZD+MP8zCS1/zEsbATGXmITpIeX wPwFFQJ9Vkg+QxKpiQXsnByIUza2+0TBYB1FCewkNQ5V8Y94DAubr49YIuHATSqxWfNl ZrdOKNA+l3TIPygAWNeDWMbb4KG4zNNim+KxJVFgBP59SYL7tUDXZATFzm9u7SkC7Oo1 AajQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iu+Zs5UGk+Sw1e/hp2BPMAgVOEPgR57kVRlii9EgTog=; b=h78ACxkWNOuI0aaCP322Va2b/CRkPlI7nMneM4Buo1i1QomTnL0PpDY+7pfC+9kEWs eREikULadVKHRXc7GYmKUmunvGLsaNKlzrlTn9TwkBkbMBclTHzGzXPGI8oKMpvYwkDf DMhfDnM1XiQcRb6uPbl/fnBicLeVNPE5VqYbbAfE75zT2v/ff7b+S/o22TPSTazv+M0M +cLWQt60ntwrb3PX0oxqwM+6fKiDVC0hqaAWo2NJQXjge1GKL6/BOUUt219z7IT/no8d CVFMed5M6Gr1KuUbSbkKBNp7aXggSebf2GHb/PaSeSW/sgUvghq/evmlpms8VNNQ0lfu dRMg== X-Gm-Message-State: AHPjjUjzee6vG5sWxi6Aby+Hx6zA0GxTIY+wrv/TbEgq4wzwA142aFqn WFcDvSKgNvUinvrzx9WR5GXFNBwe0wY= X-Google-Smtp-Source: AOwi7QArKEEnrsrriqKWU/PDhkr/5CfazndZI6/Sy8avRMzOh/DXE1L8Tc3FDzR8eKapf6OiOyqMUw== X-Received: by 10.98.207.194 with SMTP id b185mr18547550pfg.243.1507067845354; Tue, 03 Oct 2017 14:57:25 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::4:9477]) by smtp.gmail.com with ESMTPSA id u186sm7788706pgb.33.2017.10.03.14.57.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 14:57:24 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH] blk-mq-debugfs: fix device sched directory for default scheduler Date: Tue, 3 Oct 2017 14:57:16 -0700 Message-Id: <602ca75f1201b062f4f05b79f3c693e30e8bd6b9.1507067772.git.osandov@fb.com> X-Mailer: git-send-email 2.14.2 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 From: Omar Sandoval In blk_mq_debugfs_register(), I remembered to set up the per-hctx sched directories if a default scheduler was already configured by blk_mq_sched_init() from blk_mq_init_allocated_queue(), but I didn't do the same for the device-wide sched directory. Fix it. Fixes: d332ce091813 ("blk-mq-debugfs: allow schedulers to register debugfs attributes") Signed-off-by: Omar Sandoval --- Based on v4.14-rc3. block/blk-mq-debugfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 980e73095643..de294d775acf 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -815,10 +815,14 @@ int blk_mq_debugfs_register(struct request_queue *q) goto err; /* - * blk_mq_init_hctx() attempted to do this already, but q->debugfs_dir + * blk_mq_init_sched() attempted to do this already, but q->debugfs_dir * didn't exist yet (because we don't know what to name the directory * until the queue is registered to a gendisk). */ + if (q->elevator && !q->sched_debugfs_dir) + blk_mq_debugfs_register_sched(q); + + /* Similarly, blk_mq_init_hctx() couldn't do this previously. */ queue_for_each_hw_ctx(q, hctx, i) { if (!hctx->debugfs_dir && blk_mq_debugfs_register_hctx(q, hctx)) goto err;