Re: [PATCH v2 (kindof)] fs: use __fput_sync in close(2)

From: Linus Torvalds
Date: Tue Aug 08 2023 - 16:36:09 EST


On Tue, 8 Aug 2023 at 09:30, Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> At least make this really dumb and obvious and keep the ugliness to
> internal.h and open.c

See the patch I just sent out.

I hate yours too, for that nasty "bool may_delay".

I hate those "bool flag" things that change behavior of a function. It
may be obvious when you look at the function itself, and know the
code, but then it causes things like this:

return __filp_close(filp, id, true);

and there is zero clue about what the heck 'true' means.

At least then the "behavior flags" are named bitmasks, things make
*sense*. But we have too many of these boolean arguments.

And yes, I realize that we have tons of extant ones, and this would be
only one more in a sea of others. That doesn't make it ok. So please
keep it to when it *has* to be done to avoid major problems.

Linus