Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp955439ybh; Wed, 15 Jul 2020 21:55:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi9NFGtGsvqEBDGuTtR+76J/E2hinw8B9ubQXfWMLJogT3srpfjjVbMhWh1LyIK93JjR04 X-Received: by 2002:a17:906:46d1:: with SMTP id k17mr2091041ejs.446.1594875305176; Wed, 15 Jul 2020 21:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594875305; cv=none; d=google.com; s=arc-20160816; b=atKvjPfyXWXa0GVxZYmeFv60VeGvaSSjguTadVN5fCN3aUM7+H1esdVFjL+BjZQckb 3JLw09FgDewXTUT6+RlQnFlIZo1aFJXW/7rYw9ySEjtJYvzeui60k7qnQBQYdLRK9ywU +arkCI03mbHiJ3+XsxXjXwDaTOjfAAGU0IdcnF0fjgUya6cFuw08QBEsxI843nY8lRrD QC5zANN/kUtEHBNPnTdu9ucqZHirzayHV7U6T0VzI+qlvM27iuuM9R6MWe0lOd6fpFlq tFN9avdbJxUZ1gJDK5U01XQ2iyFo0AL88gTI16YgUWGz9MPW+kMXct55YOvOuK/KOYqt WY8A== 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=LCi5ylYKxrfqNqYO9aX5Ao6u1iZU0MRqefCLYodHPSiIIA8hP87oodZO/pEfs9HHj4 K6MPsvaPKUD7xRUEPIHbcW5hfXdmhyzA7sI+0szrxjij+M+zNAS4wiiCA9EdRZ5YzOnp m02CJ8ruPq+MYml0PNs2RAXUo8njKCwlf1k4Q0YaEBIDpmU69zFTYnuKuCxw95wL2U3i Yy8wSsyKG1TI3XtDMAW/RuDVqOMLOGEGY/nE0Pm60Yd0KtBhNJ56Ti9BW4lQv/Suy0EZ 6rcnYB6wQ1i+pCv3qfCWA1ELNfJsTSMtjUWHkxRoO9E/uJIFZg1mlMMKp+PSk6Gwph3P fNjw== 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 a20si2319731ejb.361.2020.07.15.21.54.41; Wed, 15 Jul 2020 21:55:05 -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 S1726231AbgGPEyd (ORCPT + 99 others); Thu, 16 Jul 2020 00:54:33 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:11449 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbgGPEyc (ORCPT ); Thu, 16 Jul 2020 00:54:32 -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: Thu, 16 Jul 2020 06:54:24 +0200 Message-ID: <20200716045425.8729-2-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200716045425.8729-1-peter.enderborg@sony.com> References: <20200617133738.6631-1-peter.enderborg@sony.com> <20200716045425.8729-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