From: Peter Enderborg Date: Thu, 16 Jul 2020 07:15:10 +0000 (+0200) Subject: tracefs: Remove unnecessary debug_fs checks. X-Git-Tag: v5.9-rc1~143^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=072e133d554bb74929f902582c8cf66d9fd12771;p=thirdparty%2Fkernel%2Flinux.git tracefs: Remove unnecessary debug_fs checks. 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 Signed-off-by: Peter Enderborg Reviewed-by: Greg Kroah-Hartman Acked-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/20200716071511.26864-2-peter.enderborg@sony.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bb62269724d5f..848f67a5f16d3 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); /*