linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zubin Mithra <zsm@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: keescook@chromium.org, groeck@chromium.org, zsm@chromium.org
Subject: [PATCH] tracefs: Annotate tracefs_ops with __ro_after_init
Date: Tue, 24 Jul 2018 16:02:14 -0400	[thread overview]
Message-ID: <20180724200214.95975-1-zsm@chromium.org> (raw)

tracefs_ops is initialized inside tracefs_create_instance_dir and not
modified after. tracefs_create_instance_dir allows for initialization
only once, and is called from create_trace_instances(marked __init),
which is called from tracer_init_tracefs(marked __init).

Signed-off-by: Zubin Mithra <zsm@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
---
 fs/tracefs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index bea8ad876bf9..20e965873f27 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -53,7 +53,7 @@ static const struct file_operations tracefs_file_operations = {
 static struct tracefs_dir_ops {
 	int (*mkdir)(const char *name);
 	int (*rmdir)(const char *name);
-} tracefs_ops;
+} tracefs_ops __ro_after_init;
 
 static char *get_dname(struct dentry *dentry)
 {
-- 
2.18.0.233.g985f88cf7e-goog


             reply	other threads:[~2018-07-24 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 20:02 Zubin Mithra [this message]
2018-07-24 22:07 ` [PATCH] tracefs: Annotate tracefs_ops with __ro_after_init Kees Cook
2018-07-24 22:39   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180724200214.95975-1-zsm@chromium.org \
    --to=zsm@chromium.org \
    --cc=groeck@chromium.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).