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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux