On Wed, Aug 14, 2024 at 7:24 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > 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... I claim the stock code avoidably implements traversal differently from do_close_on_exec. The fdt reload can be trivially lifted out of the loop, does not affect what I was going for. But now that you mention this can also be done in the do_close_on_exec case -- the thread calling it is supposed to be the only consumer, so fdt can't change. that's my $0,03 here, I'm not going to further argue about it -- Mateusz Guzik <mjguzik gmail.com>