Skip to content

Commit 5eaf7f0

Browse files
beaubelgraverostedt
authored andcommitted
eventfs: Fix events beyond NAME_MAX blocking tasks
Eventfs uses simple_lookup(), however, it will fail if the name of the entry is beyond NAME_MAX length. When this error is encountered, eventfs still tries to create dentries instead of skipping the dentry creation. When the dentry is attempted to be created in this state d_wait_lookup() will loop forever, waiting for the lookup to be removed. Fix eventfs to return the error in simple_lookup() back to the caller instead of continuing to try to create the dentry. Link: https://lore.kernel.org/linux-trace-kernel/20231210213534.497-1-beaub@linux.microsoft.com Fixes: 6394044 ("eventfs: Implement eventfs lookup, read, open functions") Link: https://lore.kernel.org/linux-trace-kernel/20231208183601.GA46-beaub@linux.microsoft.com/ Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent b55b0a0 commit 5eaf7f0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/tracefs/event_inode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ static struct dentry *eventfs_root_lookup(struct inode *dir,
546546
if (strcmp(ei_child->name, name) != 0)
547547
continue;
548548
ret = simple_lookup(dir, dentry, flags);
549+
if (IS_ERR(ret))
550+
goto out;
549551
create_dir_dentry(ei, ei_child, ei_dentry, true);
550552
created = true;
551553
break;
@@ -568,6 +570,8 @@ static struct dentry *eventfs_root_lookup(struct inode *dir,
568570
if (r <= 0)
569571
continue;
570572
ret = simple_lookup(dir, dentry, flags);
573+
if (IS_ERR(ret))
574+
goto out;
571575
create_file_dentry(ei, i, ei_dentry, name, mode, cdata,
572576
fops, true);
573577
break;

0 commit comments

Comments
 (0)