Skip to content

Support selectable file descriptors

Jens Axboe io-uring 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 12 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fs: openat2: Extend open_how to allow userspace-selected fdsfs/fcntl.c fs/file.c fs/io_uring.c +5 more+49 -60 replies
2/6io_uring: move CLOSE req->file checking into handlerfs/io_uring.c+4 -30 replies
3/6io_uring: move read/write side file based prep into op handlerfs/io_uring.c+44 -290 replies
4/6io_uring: support deferred retrival of file from fdfs/io_uring.c+19 -20 replies
5/6net: allow specific fd selection for __sys_accept4_file()include/linux/socket.h net/socket.c+6 -40 replies
6/6io_uring: allow specific fd for IORING_OP_ACCEPTfs/io_uring.c+7 -23 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosh Triplett
SeriesR-b
1/6
2/6
3/6
4/6
5/6
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCHSET v2 0/6] Support selectable file descriptors

One of the fabled features with chains has long been the desire to support things like:

<open fileX><read from fileX><close fileX>

in a single chain. This currently doesn't work, since the read/close depends on what file descriptor we get on open.

The original attempt at solving this provided a means to pass descriptors between chains in a link, this version takes a different route. Based on Josh's support for O_SPECIFIC_FD, we can instead control what fd value we're going to get out of open (or accept). With that in place, we don't need to do any magic to make this work. The above chain then becomes:

<open fileX with fd Y><read from fd Y><close fd Y>

which is a lot more useful, and allows any sort of weird chains without needing to nest "last open" file descriptors.

Updated the test program to use this approach:

https://git.kernel.dk/cgit/liburing/plain/test/orc.c?h=fd-select

which forces the use of fd==89 for the open, and then uses that for the read and close.

Outside of this adaptation, fixed a few bugs and cleaned things up.

Signature · 1 line
Jens Axboe