Skip to content

eventfs: Don't use dcache_readdir() for getdents()

Steven Rostedt linux-fsdevel linux-trace-kernel lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2eventfs: Remove "lookup" parameter from create_dir/file_dentry()fs/tracefs/event_inode.c+20 -350 replies
2/2eventfs: Stop using dcache_readdir() for getdents()fs/tracefs/event_inode.c+64 -1300 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] eventfs: Don't use dcache_readdir() for getdents()

After having a "pleasant" conversation with Linus over on the security mailing list, we came to the conclusion that eventfs should not be using the dcache_readdir() routine for iterating the entries of a directory (getdents()).

Instead, the .open and .release callbacks of the directory file operations was removed and all the work is now done in the .iterate_shared.

The function dcache_readdir_wrapper() was renamed to eventfs_iterate().

As the files and directories of eventfs is all known within the meta data, it can easily supply getdents() with the information it needs without traversing the dentry.

Changes since v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

- Broke up into two patches, one to fix the lookup parameter and the other to do the meat of the change.

- Moved the ctx->pos count up to skip creating of dentries in those cases.

Steven Rostedt (Google) (2):
eventfs: Remove "lookup" parameter from create_dir/file_dentry()
eventfs: Stop using dcache_readdir() for getdents()

----

 fs/tracefs/event_inode.c | 241 ++++++++++++++++-------------------------------
 1 file changed, 80 insertions(+), 161 deletions(-)