diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-09-21 16:15:29 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-10-05 13:02:39 +0200 |
| commit | 2eb8f7b0375111ee23de4e731ef737c411297088 (patch) | |
| tree | 8e0e33a5bb9f46df47dc1b953988a024357f2467 /tools/lib/python/kdoc | |
| parent | fd73f4a6659897191fa0d40695fe370925dd3780 (diff) | |
| download | linux-next-2eb8f7b0375111ee23de4e731ef737c411297088.tar.gz linux-next-2eb8f7b0375111ee23de4e731ef737c411297088.zip | |
file: let dup_fd() leave the punched hole behind
close_range(CLOSE_RANGE_UNSHARE) passed the range it is about to close
to dup_fd() so the clone is done without that range. This only works
when the last open descriptor falls into the range. A range in the
middle of the table is copied like everything else. That's wasteful.
Don't copy them. Descriptors in a skipped range stay open in the source
fdtable. They are never copied into the new table and no reference is
taken on them. Figuring out the size of the table follows the same rule.
That drops the special-case it has now.
This also means we stop calling ->flush() on fds from a table they
were never part of. With the range at the top of the table that was
already mostly the case.
Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-1-c20d0b49270d@kernel.org
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
