eventfs: Save ownership and mode
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 1 Nov 2023 17:25:45 +0000 (13:25 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 2 Nov 2023 03:55:12 +0000 (23:55 -0400)
commit28e12c09f5aa081b2d13d1340e3610070b6c624d
tree19d23158cb294a7c8eca32d1863bd537f11c935b
parent77a06c33a22d13f3a6e31f06f6ee6bca666e6898
eventfs: Save ownership and mode

Now that inodes and dentries are created on the fly, they are also
reclaimed on memory pressure. Since the ownership and file mode are saved
in the inode, if they are freed, any changes to the ownership and mode
will be lost.

To counter this, if the user changes the permissions or ownership, save
them, and when creating the inodes again, restore those changes.

Link: https://lkml.kernel.org/r/20231101172649.691841445@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ajay Kaher <akaher@vmware.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: 63940449555e7 ("eventfs: Implement eventfs lookup, read, open functions")
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/event_inode.c
fs/tracefs/internal.h