Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp534596ybh; Wed, 15 Jul 2020 08:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUYrqfGQkxvWj1OfHBnQ2vEecZ6bxy7xfNFBBKBZ7DDNpiqr0r1Vjy//0uAlXbzeke5huj X-Received: by 2002:a17:906:9354:: with SMTP id p20mr9597503ejw.187.1594826894607; Wed, 15 Jul 2020 08:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594826894; cv=none; d=google.com; s=arc-20160816; b=O4qkwwGpJWiUON3dUzZb40IVKtxGtxF+zO4KBxsX4HKpsinPTvjCp69O3zc1dkS4D5 ik4mwkIFZhc4h4BOe/L3L21ZiPLayHXr1i/K8veng6dEo0FdqbRv2SekT9IQH2QxHaFd ps+Gl3jokV1XlXaoVFeTyN0a+dmCReCRi0Kwam8FRgmSgg4S9VYlCrDRD1YoF4fwAXHD CwoDvNV0x/NezekwA75bRFshMZzZe4UPAcTYEilGqdctuH6qXNkuGTX48nFAZ2w4OkRk InxBG6D8Jc1Dp9rAZ+OrmBDAQ5iXIzQ91VlBEvXYWXVghLrAUM8aPucMvsSoE9R2tqyn z2oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=QOJfvtkg6tkXUkbPnEqI8Fnf+PnMlbmPjcSKgUSsq8s=; b=zXSO+H789kV7Oi3ieatHdFUbsKqP1YpAkNoi+yvachvfbGxgzCBYug62MfCNR0Rt/B dq+DdFQpFeG8oDp1YQ4qoyPMBWHjQQYT5AZ5Ab81za4dde6THhWqaSCdEl0quka3AQPh 8AsrcESiAJU+ic1qP755TJlZzk0HZ/QZ2ECOGqQ/rASoqJkYgTCZokMCm36UzirhdKus I9ZH0WAp8GJ7DffSCF9/juIwEd7IkM/apRgzSkWKFvXNuOWIHkl+8LchRFo9AwFMWgef b0lKg+WaIzauTWlhRulUJGeq+luDdmyDX65MCoVbhNizBEsXeV4KNn8M+vBJGYP9BMPQ iesg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si1447405ejp.69.2020.07.15.08.27.51; Wed, 15 Jul 2020 08:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbgGOPZj (ORCPT + 99 others); Wed, 15 Jul 2020 11:25:39 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:15024 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbgGOPZh (ORCPT ); Wed, 15 Jul 2020 11:25:37 -0400 From: Peter Enderborg To: Greg Kroah-Hartman , , "Rafael J . Wysocki" , Andrew Morton , Jonathan Corbet , , Randy Dunlap , Steven Rostedt , Ingo Molnar CC: Peter Enderborg Subject: [PATCH 1/2] tracefs: Remove unnecessary debug_fs checks. Date: Wed, 15 Jul 2020 17:25:28 +0200 Message-ID: <20200715152529.11223-2-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200715152529.11223-1-peter.enderborg@sony.com> References: <20200617133738.6631-1-peter.enderborg@sony.com> <20200715152529.11223-1-peter.enderborg@sony.com> MIME-Version: 1.0 Content-Type: text/plain X-SEG-SpamProfiler-Analysis: v=2.3 cv=CszBjUwD c=1 sm=1 tr=0 a=Jtaq2Av1iV2Yg7i8w6AGMw==:117 a=_RQrkK6FrEwA:10 a=QyXUC8HyAAAA:8 a=z6gsHLkEAAAA:8 a=ag1SF4gXAAAA:8 a=meVymXHHAAAA:8 a=g-dhFznQ5d8k2vTQpKYA:9 a=d-OLMTCWyvARjPbQ-enb:22 a=Yupwre4RP9_Eg_Bd0iYG:22 a=2JgSa4NbpEOStq-L5dxp:22 X-SEG-SpamProfiler-Score: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) --- 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