Message ID | 20240201161617.499712009@goodmis.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | eventfs: More fixes and clean ups | expand |
On Thu, 01 Feb 2024 10:34:51 -0500 Steven Rostedt <rostedt@goodmis.org> wrote: > --- a/fs/tracefs/event_inode.c > +++ b/fs/tracefs/event_inode.c > @@ -483,7 +483,7 @@ static struct dentry *eventfs_root_lookup(struct inode *dir, > struct dentry *result = NULL; > > ti = get_tracefs(dir); > - if (!(ti->flags & TRACEFS_EVENT_INODE)) > + if (WARN_ON_ONCE!(ti->flags & TRACEFS_EVENT_INODE))) I added this patch at the end but never tested it :-p I then did a rebase to move it ahead of patch 6, which was tested. Will resend this patch. -- Steve > return ERR_PTR(-EIO); > > mutex_lock(&eventfs_mutex);
diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 110e8a272189..1a831ba1042b 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -483,7 +483,7 @@ static struct dentry *eventfs_root_lookup(struct inode *dir, struct dentry *result = NULL; ti = get_tracefs(dir); - if (!(ti->flags & TRACEFS_EVENT_INODE)) + if (WARN_ON_ONCE!(ti->flags & TRACEFS_EVENT_INODE))) return ERR_PTR(-EIO); mutex_lock(&eventfs_mutex); @@ -495,7 +495,8 @@ static struct dentry *eventfs_root_lookup(struct inode *dir, list_for_each_entry(ei_child, &ei->children, list) { if (strcmp(ei_child->name, name) != 0) continue; - if (ei_child->is_freed) + /* A child is freed and removed from the list at the same time */ + if (WARN_ON_ONCE(ei_child->is_freed)) goto out; result = lookup_dir_entry(dentry, ei, ei_child); goto out;