Skip to content

RFC fs,epoll: Add ability to call kcmp to find target files

Cyrill Gorcunov linux-api linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 of 3 patches 13 repliesIn review

2 of 3 patches are in this archive. The cover letter announces 3.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3procfs: fdinfo -- Extend information about epoll target filesDocumentation/filesystems/proc.txt fs/eventpoll.c+11 -38 replies
2/3kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target filesfs/eventpoll.c include/linux/eventpoll.h include/uapi/linux/kcmp.h +1 more+99 -05 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

Hi! In previous series EPOLL_CTL_DUP operation has been discussed but considered as potentially scary. So here is an another approach:

- extend fdinfo of epoll files with inode, device and file position for every target, which allow the reader to gather targets with this bundle as a key for primary sorting

- extent kcmp to check if some particular file is matching one sitting inside epoll queue (duplicate numbers are resolved with offset parameter)

Please take a look once time permit. Note that I did only basic testing (without CRIU) but it should fit our needs because we sort and lookup regualr files by same scheme. So I'm about to implemet full criu support for this new kernel features in a couple of days thus any comments are *higly* appreciated.

NB: Initially I added

	if (file_ns_capable(epi->ffd.file, ns, CAP_SYS_ADMIN))

into fdinfo output to check if caller is allowed to see target ino/dev/pos but dropped it later because if process is added file descriptor into epoll queue it mean fdstat and such already can be called and this information is already obtained, so I don't this it's information disclosure.

Cyrill