Re: [PATCH] close_files(): reimplement based on do_close_on_exec()

From: Al Viro
Date: Wed Aug 14 2024 - 01:24:34 EST


On Mon, Aug 12, 2024 at 09:56:58AM +0200, Mateusz Guzik wrote:
> While here take more advantage of the fact nobody should be messing with
> the table anymore and don't clear the fd slot.
>
> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
> ---
>
> how about this instead, I think it's a nicer clean up.

> It's literally do_close_on_exec except locking and put fd are deleted.

TBH, I don't see much benefit that way - if anything, you are doing
a bunch of extra READ_ONCE() of the same thing (files->fdt), for no
visible reason...