From patchwork Thu Feb 2 17:01:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9552499 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 85703602F0 for ; Thu, 2 Feb 2017 17:02:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7987428408 for ; Thu, 2 Feb 2017 17:02:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E60F2849C; Thu, 2 Feb 2017 17:02:18 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 E204928408 for ; Thu, 2 Feb 2017 17:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751599AbdBBRCR (ORCPT ); Thu, 2 Feb 2017 12:02:17 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:35666 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbdBBRCQ (ORCPT ); Thu, 2 Feb 2017 12:02:16 -0500 Received: by mail-pg0-f51.google.com with SMTP id 194so7137858pgd.2 for ; Thu, 02 Feb 2017 09:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=miNDtUeenastbbFq4NAxHw/USTz7byIRSTVTRminM4A=; b=qhglt+ermRizn1TYBlrbtiERlR3Js7M/DEqYSRkUJqdb9WMN00tLvrl0ivnC796G6z 1CbWWzk9LJDzJ9v0k815+ipOo9UfuEtN13g93UceUa1yTZyVf+Tj4hjDniegwfxIUlLe YhxvQiY5hLlzT31/Bo+Dh/qyY3RrKLzjyVaA8JZzw4hBUju8ZtxzcjQdUVs21VWUhB0B F/h7iFXPW8vYozsezCfhXYx2S3ki2W359zQvUwNArM3il40IGadnDQR8l12743e2D4Pc 5rwsAnewFkQ46ANK6u89l0gduMDCBLYZxJ8PKRE9o7o5v81J11WDEqKX+WZ9Y9jKg+ae 6lJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=miNDtUeenastbbFq4NAxHw/USTz7byIRSTVTRminM4A=; b=CooMhLhq1BBMchcYNm3yaJMq214eWnnaSdMStfBZOjc5IPP/3yqQbW0PTlhpKmZ2OG /upGvIfM6QJlM634/YUhXSGzPzMMX513lYfZjCV5HN7Mo3de9d0A+qg4F7iYAm7cU1sG dSK56y1BZl/8QFEi5yP72JNseiVObh8wnTB8a2vtbVCFnDOjQlYoNf/DLyxTwBunV3/i qKrVdgcZbFUNuvJSFRi/nIbHNghCZmg8FgQAUn64+aeh2npf7rtPCgJZZe6+wGLG5Ia7 JGK+MdNh7ICB5E5El8P0bRN3qrwN3DeEy6TNqZHXI9ihNXM8CSKHjnldjdQKm8f9wffr //fw== X-Gm-Message-State: AIkVDXJlmnWghEkFCVNbf+AfY+dTVvTszRWxe/my18BmaLXNaJrzHdUM21l4KRV6wpOVTqms X-Received: by 10.99.65.67 with SMTP id o64mr11562514pga.119.1486054935612; Thu, 02 Feb 2017 09:02:15 -0800 (PST) Received: from vader ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id d69sm59944852pfd.11.2017.02.02.09.02.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 09:02:14 -0800 (PST) Date: Thu, 2 Feb 2017 09:01:45 -0800 From: Omar Sandoval To: Greg Kroah-Hartman Cc: Jens Axboe , linux-block@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 0/6] block: fix blk-mq debugfs vs. blktrace Message-ID: <20170202170145.GA31613@vader> References: <20170201081608.GB18278@kroah.com> <20170201083115.GA16278@vader> <20170202105853.GA27128@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170202105853.GA27128@kroah.com> User-Agent: Mutt/1.7.2 (2016-11-26) 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 On Thu, Feb 02, 2017 at 11:58:53AM +0100, Greg Kroah-Hartman wrote: > On Wed, Feb 01, 2017 at 12:31:15AM -0800, Omar Sandoval wrote: > > On Wed, Feb 01, 2017 at 09:16:08AM +0100, Greg Kroah-Hartman wrote: > > > On Tue, Jan 31, 2017 at 02:53:16PM -0800, Omar Sandoval wrote: > > > > From: Omar Sandoval > > > > > > > > When I moved the blk-mq debugging information to debugfs, I didn't > > > > realize that blktrace also created directories in debugfs that > > > > conflicted with the blk-mq directories. This series fixes that. > > > > > > > > Patch 1 adds a new debugfs helper needed for patch 6. Greg, could I get > > > > an ack on that if it makes sense? Jens and I went back and forth on this > > > > for a little while, but patch 6 has more of the rationale on why we > > > > decided that this approach was the cleanest. > > > > > > I can't find patch 6, you only cc:ed me on the first patch :( > > > > > > Care to bounce them all to me? > > > > > > thanks, > > > > > > greg k-h > > > > Gah, I forgot --cc-cover to git-send-email. The series is all here: > > http://marc.info/?l=linux-block&r=1&b=201701&w=2. I can also send the > > patches directly to you if you prefer that. > > I don't understand the problem here. How do you not know if you have > created the debugfs file or not? You have the structure, with the > correct name, how could it have been created? Can't you save the dentry > to the debugfs file in the structure that has the name? > > thanks, > > greg k-h Hey, Greg, So here's the alternative to doing the lookup: So we could figure out if it exists, but it's very special-cased and fragile. And then there's this further up: /* * some device names have larger paths - convert the slashes * to underscores for this to work as expected */ strreplace(buts->name, '/', '_'); which I'm not sure applies anymore but would also break this. Doing the lookup is just more foolproof. Thanks, Omar --- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 38052f625a0f..79ef6b9d1f96 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -470,12 +470,15 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, if (!blk_debugfs_root) goto err; - dir = debugfs_create_dir(buts->name, blk_debugfs_root); - +#ifdef CONFIG_BLK_DEBUG_FS + if (q->mq_ops && !bdev->bd_part.partno) + dir = q->debugfs_dir; +#endif + if (!dir) + bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root); if (!dir) goto err; - bt->dir = dir; bt->dev = dev; atomic_set(&bt->dropped, 0); INIT_LIST_HEAD(&bt->running_list);