diff options
author | Mateusz Guzik <mjguzik@gmail.com> | 2025-03-20 11:26:37 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-03-20 15:17:56 +0100 |
commit | 4dec4f91359c456a5eea26817ea151b42953432e (patch) | |
tree | 48bdebd75b06672be38b213be46cfabde08820d7 /mm | |
parent | c918f15420e336a964f8f12d9c1134859a147d42 (diff) |
fs: sort out fd allocation vs dup2 race commentary, take 2
fd_install() has a questionable comment above it.
While it correctly points out a possible race against dup2(), it states:
> We need to detect this and fput() the struct file we are about to
> overwrite in this case.
>
> It should never happen - if we allow dup2() do it, _really_ bad things
> will follow.
I have difficulty parsing the above. The first sentence would suggest
fd_install() tries to detect and recover from the race (it does not),
the next one claims the race needs to be dealt with (it is, by dup2()).
Given that fd_install() does not suffer the burden, this patch removes
the above and instead expands on the race in dup2() commentary.
While here tidy up the docs around fd_install().
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20250320102637.1924183-1-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions