linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Enderborg <peter.enderborg@sony.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>, <linux-doc@vger.kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: Peter Enderborg <peter.enderborg@sony.com>
Subject: [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.
Date: Wed, 15 Jul 2020 17:25:28 +0200	[thread overview]
Message-ID: <20200715152529.11223-2-peter.enderborg@sony.com> (raw)
In-Reply-To: <20200715152529.11223-1-peter.enderborg@sony.com>

This is a preparation for debugfs restricted mode.
We don't need debugfs to trace, the removed check stop tracefs to work
if debugfs is not initialised. We instead tries to automount within
debugfs and relay on it's handling. The code path is to create a
backward compatibility from when tracefs was part of debugfs, it is now
standalone and does not need debugfs. When debugfs is in restricted
it is compiled in but not active and return EPERM to clients and
tracefs wont work if it assumes it is active it is compiled in
kernel.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Enderborg <peter.enderborg@sony.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index bb62269724d5..848f67a5f16d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8945,9 +8945,7 @@ struct dentry *tracing_init_dentry(void)
 	if (tr->dir)
 		return NULL;
 
-	if (WARN_ON(!tracefs_initialized()) ||
-		(IS_ENABLED(CONFIG_DEBUG_FS) &&
-		 WARN_ON(!debugfs_initialized())))
+	if (WARN_ON(!tracefs_initialized()))
 		return ERR_PTR(-ENODEV);
 
 	/*
-- 
2.17.1


  reply	other threads:[~2020-07-15 15:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 13:37 [PATCH v3] debugfs: Add access restriction option Peter Enderborg
2020-06-17 14:15 ` Greg Kroah-Hartman
2020-06-17 14:39   ` Enderborg, Peter
2020-06-17 15:10 ` Randy Dunlap
2020-06-22  8:30 ` [PATCH v4 0/2] " Peter Enderborg
2020-06-22  8:30   ` [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks Peter Enderborg
2020-06-22  9:18     ` Greg Kroah-Hartman
2020-06-22 13:47     ` Steven Rostedt
2020-06-22  8:30   ` [PATCH 2/2] debugfs: Add access restriction option Peter Enderborg
2020-07-10 13:06     ` Greg Kroah-Hartman
2020-07-15  8:42 ` [PATCH v5 0/2] " Peter Enderborg
2020-07-15  8:42   ` [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks Peter Enderborg
2020-07-15  8:42   ` [PATCH 2/2] debugfs: Add access restriction option Peter Enderborg
2020-07-15  9:39     ` Greg Kroah-Hartman
2020-07-15 10:03       ` Enderborg, Peter
2020-07-15 10:35         ` Greg Kroah-Hartman
2020-07-15 10:59           ` Enderborg, Peter
2020-07-21  6:47       ` Enderborg, Peter
2020-07-15 15:25 ` [PATCH v6 0/2] " Peter Enderborg
2020-07-15 15:25   ` Peter Enderborg [this message]
2020-07-15 15:25   ` [PATCH 2/2] " Peter Enderborg
2020-07-16  3:30     ` Randy Dunlap
2020-07-16  4:54 ` [PATCH v7 0/2] " Peter Enderborg
2020-07-16  4:54   ` [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks Peter Enderborg
2020-07-16  4:54   ` [PATCH 2/2] debugfs: Add access restriction option Peter Enderborg
2020-07-16  5:12     ` Randy Dunlap
2020-07-16  7:15 ` [PATCH v8 0/2] " Peter Enderborg
2020-07-16  7:15   ` [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks Peter Enderborg
2020-07-16  7:15   ` [PATCH 2/2] debugfs: Add access restriction option Peter Enderborg
2020-07-16 15:26     ` Randy Dunlap
2020-07-23 15:11   ` [PATCH v8 0/2] " Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200715152529.11223-2-peter.enderborg@sony.com \
    --to=peter.enderborg@sony.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).