• Steven Rostedt (Google)'s avatar
    eventfs: Cleanup permissions in creation of inodes · 6e3d7c90
    Steven Rostedt (Google) authored
    The permissions being set during the creation of the inodes was updating
    eventfs_inode attributes as well. Those attributes should only be touched
    by the setattr or remount operations, not during the creation of inodes.
    The eventfs_inode attributes should only be used to set the inodes and
    should not be modified during the inode creation.
    
    Simplify the code and fix the situation by:
    
     1) Removing the eventfs_find_events() and doing a simple lookup for
        the events descriptor in eventfs_get_inode()
    
     2) Remove update_events_attr() as the attributes should only be used
        to update the inode and should not be modified here.
    
     3) Add update_inode_attr() that uses the attributes to determine what
        the inode permissions should be.
    
     4) As the parent_inode of the eventfs_root_inode structure is no longer
        needed, remove it.
    
    Now on creation, the inode gets the proper permissions without causing
    side effects to the ei->attr field.
    
    Link: https://lore.kernel.org/lkml/20240522165031.944088388@goodmis.org
    
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    6e3d7c90
event_inode.c 23.3 KB