Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2570306ybt; Mon, 22 Jun 2020 01:32:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoRWCbLnKctE0QgD7eA/ip/pRg93X6rffVkuoWajNg0L7m+axWkn2/UmtQTtbXnhaH9UG3 X-Received: by 2002:a17:906:d9cd:: with SMTP id qk13mr14653468ejb.268.1592814769984; Mon, 22 Jun 2020 01:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592814769; cv=none; d=google.com; s=arc-20160816; b=JOzhMYOl5MeMevYqghTVYj9uN4F9qFPP8YwT8LZdiI/lXlwjYaB5uyl12M3gz/L0OP 5C5yvKUQo/ZHM7RNxQi+euepy/6dQboNemPzVu8is2/qfFFERC4Va92tEnJb5IsrZc8B JRg7vF/JsYDAEbexpr/Qx4fr18Zm3OXe5694r7rRmSIhi09SdkWtQ5FqXDTUQLky00U7 MKmXZ8mc8lL3OkTmcfNLUELkvP+EgWSL4EuTDdcRMaY1MJ7PncTI8NoJ41BIr6jxUOqG zj4fCbNqNWxh1+2uhuTemSaKXJJaymH+oPdV89NL1sRhUR2UeywZZtibHZR+gu93ews+ 0FMQ== 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=suA8uxbq7jwsgmYrET7+3XAzVsrwqkwqRJcNmoD8j78=; b=sxJVm1+GX1T1ax+veFZivEYNteTZIzeTFuEGfdoxFwtXHLaGfcpMOrvK4or3A7WhKb FHArbQpjmwlaQBky2p5kL+XGJ4Pe4b/Gm36uNKH8eE7/PmEP2LjPLj3ZhGs94a7ncmW6 ytb7qzMkI9Jf2qIV0L5+YkOXZct9y+3rT7BmMeMQ4JumIWseoyWutubMyKzV+spf0Z9z D+BuS1kGr/bW2uSowrPtq4Ws5m9nN3iRZO5zijVwZAGLOjIPpFR+bGTRkoCwTxThgEhH qRhp5JMqdzM/jM1hAfZ4XO1g9Q8L4v0dsreAfOYjBUWDSWTHD/wjDMHefExGHE8A7wYp a56g== 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 bu11si5005890ejb.686.2020.06.22.01.32.26; Mon, 22 Jun 2020 01:32:49 -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 S1725976AbgFVIao (ORCPT + 99 others); Mon, 22 Jun 2020 04:30:44 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:15473 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgFVIan (ORCPT ); Mon, 22 Jun 2020 04:30:43 -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: Mon, 22 Jun 2020 10:30:18 +0200 Message-ID: <20200622083019.15479-2-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200622083019.15479-1-peter.enderborg@sony.com> References: <20200617133738.6631-1-peter.enderborg@sony.com> <20200622083019.15479-1-peter.enderborg@sony.com> MIME-Version: 1.0 Content-Type: text/plain X-SEG-SpamProfiler-Analysis: v=2.3 cv=B7jHL9lM c=1 sm=1 tr=0 a=Jtaq2Av1iV2Yg7i8w6AGMw==:117 a=nTHF0DUjJn0A:10 a=QyXUC8HyAAAA:8 a=z6gsHLkEAAAA:8 a=g-dhFznQ5d8k2vTQpKYA:9 a=d-OLMTCWyvARjPbQ-enb: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 --- 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 ec44b0e2a19c..34ed82364edb 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -8946,9 +8946,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.26.2