/*
  * eventfs_mutex protects the eventfs_inode (ei) dentry. Any access
  * to the ei->dentry must be done under this mutex and after checking
- * if ei->is_freed is not set. The ei->dentry is released under the
- * mutex at the same time ei->is_freed is set. If ei->is_freed is set
- * then the ei->dentry is invalid.
+ * if ei->is_freed is not set. When ei->is_freed is set, the dentry
+ * is on its way to being freed after the last dput() is made on it.
  */
 static DEFINE_MUTEX(eventfs_mutex);
 
 /*
  * The eventfs_inode (ei) itself is protected by SRCU. It is released from
  * its parent's list and will have is_freed set (under eventfs_mutex).
- * After the SRCU grace period is over, the ei may be freed.
+ * After the SRCU grace period is over and the last dput() is called
+ * the ei is freed.
  */
 DEFINE_STATIC_SRCU(eventfs_srcu);
 
                 * created the dentry for this e_dentry. In which case
                 * use that one.
                 *
-                * Note, with the mutex held, the e_dentry cannot have content
-                * and the ei->is_freed be true at the same time.
+                * If ei->is_freed is set, the e_dentry is currently on its
+                * way to being freed, don't return it. If e_dentry is NULL
+                * it means it was already freed.
                 */
-               dentry = *e_dentry;
-               if (WARN_ON_ONCE(dentry && ei->is_freed))
+               if (ei->is_freed)
                        dentry = NULL;
+               else
+                       dentry = *e_dentry;
                /* The lookup does not need to up the dentry refcount */
                if (dentry && !lookup)
                        dget(dentry);
                 * created the dentry for this e_dentry. In which case
                 * use that one.
                 *
-                * Note, with the mutex held, the e_dentry cannot have content
-                * and the ei->is_freed be true at the same time.
+                * If ei->is_freed is set, the e_dentry is currently on its
+                * way to being freed.
                 */
                dentry = ei->dentry;
                if (dentry && !lookup)