Re: [RFC PATCH] fs: elide the smp_rmb fence in fd_install()
From: Mateusz Guzik
Date: Thu Dec 05 2024 - 10:07:42 EST
On Thu, Dec 5, 2024 at 3:58 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> On Thu, Dec 05, 2024 at 01:03:32PM +0100, Mateusz Guzik wrote:
> > + BUG_ON(files->resize_in_progress);
>
> I think this BUG_ON() here is a bit unnecessary.
>
I'm an assert-friendly guy, but I'm not going to argue about this one.
> > + files->resize_in_progress = true;
>
> Minor: Why move that into expand_fdtable()? Having
> files->resize_in_progress in here doesn't add much more clarity than
> just having it set around expand_fdtable() in the caller.
>
> Leaving it there also makes the patch smaller and clearer to follow as
> you neither need the additional err nor the goto.
The is indeed not the best looking goto in the world, but per the
commit message I moved the flag in so that it can be easier referred
to when describing synchronisation against fd_install.
--
Mateusz Guzik <mjguzik gmail.com>