]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "eventfs: Check for NULL ef in eventfs_set_attr()"
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 6 Feb 2024 12:09:07 +0000 (07:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:18 +0000 (09:25 +0100)
This reverts commit d8f492a059728bbd397defbc9b8d2f4159d869b5.

The eventfs was not designed properly and may have some hidden bugs in it.
Linus rewrote it properly and I trust his version more than this one. Revert
the backported patches for 6.6 and re-apply all the changes to make it
equivalent to Linus's version.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/tracefs/event_inode.c

index efbdc47c74dcf7678b57b0299a2e8dbd8c81c4ce..5fcfb634fec26a7606113db7b8ec196d8f3e5e96 100644 (file)
@@ -113,14 +113,14 @@ static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry,
 
        mutex_lock(&eventfs_mutex);
        ef = dentry->d_fsdata;
-       if (ef && ef->is_freed) {
+       if (ef->is_freed) {
                /* Do not allow changes if the event is about to be removed. */
                mutex_unlock(&eventfs_mutex);
                return -ENODEV;
        }
 
        ret = simple_setattr(idmap, dentry, iattr);
-       if (!ret && ef)
+       if (!ret)
                update_attr(ef, iattr);
        mutex_unlock(&eventfs_mutex);
        return ret;