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

From: David Laight
Date: Wed Aug 09 2023 - 05:03:19 EST


From: Linus Torvalds
> Sent: 08 August 2023 18:05
...
> 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 make the usual case 0.

I was chasing through some code that has a flag for a
conditional lock.
However is was 'NEED_TO_LOCK' not 'ALREADY_LOCKED'.
(bpf calling in with the socket locked).

As well as making the code harder to read it is an accident
just waiting to happen.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)