Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp299609ybh; Wed, 15 Jul 2020 02:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsZvoe+GHrvzBnCBusdOJ/Zzp6qAdFa4tWYssBVPv+cMfEAiUaV9aOjGM9orCzHBb2UKAn X-Received: by 2002:a50:e801:: with SMTP id e1mr8476393edn.251.1594804434879; Wed, 15 Jul 2020 02:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594804434; cv=none; d=google.com; s=arc-20160816; b=LO9lEkF7SSBLyDdlTV4KOV3B8bojJIh+llPO2e5iNu2WD8IUMwYU5Oe7aDWVvFFfWr XtYxsptMxjMuTyMJtP3x2mAm6coiEmleImAbN+d5c7bpSY6ztV8pps+xfJvvx5UsIS9d AA1XFQBT6uEjJSciTBT5d5uS3OWTKroA/JYplWiD9EyHrG3MRHCSpW8JrWzmTxX+YbKQ 0sWlnAgspcJT2dZthQqy6jYuIA2q1fsz6is1/QXiBcnldlbHXtlNXWbg9q72Byn8ev85 SY6VYWLZmSmKWxeMPyLKHkCakS51z7+ppOd7W+LFTUdLhJHtzzeLiZSJFv8gkjRsH+rv KcyA== 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=AcDk+7B57DmMX2afP3cJRCYSaphFB/aAB67p6cxSx58/LTNPSrN5rET5R5Ts0lY3wj owufORaccPdzC9EQxBB4NX/o8tp7WiEbbSQPT6LlUhnnbiqx+NJsIkGWBA/upGOfLi7o 6IUeA+2rueKF4XDbbfPlUljr96o0ssCPUDHWZNwTL4SFVGsGneNQpp5PUMy++JI9H9az MbIRzMQ9Q3OQLXXIQGef1I9rGNWp9U+eMrB2lR0k3C4ROYxpy2eiXHM881XkGRIGiTYW s2toJAdFLXkmIQorFtCKANf+syKVQpxMRCYKaD618CI4g1PqIIa9UdSNLZ+4tb0TWuzE I6IA== 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 v14si925612edq.527.2020.07.15.02.13.31; Wed, 15 Jul 2020 02:13:54 -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 S1730363AbgGOImZ (ORCPT + 99 others); Wed, 15 Jul 2020 04:42:25 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:5411 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729475AbgGOImX (ORCPT ); Wed, 15 Jul 2020 04:42:23 -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 10:42:06 +0200 Message-ID: <20200715084207.7639-2-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200715084207.7639-1-peter.enderborg@sony.com> References: <20200617133738.6631-1-peter.enderborg@sony.com> <20200715084207.7639-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=kIrCkORFHx6JeP9rmF/Kww==: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