struct eventfs_attr *attr = NULL;
        struct dentry **e_dentry = &ei->d_children[idx];
        struct dentry *dentry;
-       bool invalidate = false;
 
        mutex_lock(&eventfs_mutex);
        if (ei->is_freed) {
                 * Otherwise it means two dentries exist with the same name.
                 */
                WARN_ON_ONCE(!ei->is_freed);
-               invalidate = true;
+               dentry = NULL;
        }
        mutex_unlock(&eventfs_mutex);
 
-       if (invalidate)
-               d_invalidate(dentry);
-
-       if (lookup || invalidate)
+       if (lookup)
                dput(dentry);
 
-       return invalidate ? NULL : dentry;
+       return dentry;
 }
 
 /**
 create_dir_dentry(struct eventfs_inode *pei, struct eventfs_inode *ei,
                  struct dentry *parent, bool lookup)
 {
-       bool invalidate = false;
        struct dentry *dentry = NULL;
 
        mutex_lock(&eventfs_mutex);
                 * Otherwise it means two dentries exist with the same name.
                 */
                WARN_ON_ONCE(!ei->is_freed);
-               invalidate = true;
+               dentry = NULL;
        }
        mutex_unlock(&eventfs_mutex);
-       if (invalidate)
-               d_invalidate(dentry);
 
-       if (lookup || invalidate)
+       if (lookup)
                dput(dentry);
 
-       return invalidate ? NULL : dentry;
+       return dentry;
 }
 
 /**