From: David Laight <David.Laight@ACULAB.COM>
To: 'Linus Torvalds' <torvalds@linux-foundation.org>,
Christian Brauner <brauner@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"oleg@redhat.com" <oleg@redhat.com>,
Matthew Wilcox <willy@infradead.org>
Subject: RE: [PATCH v2 (kindof)] fs: use __fput_sync in close(2)
Date: Wed, 9 Aug 2023 09:03:05 +0000 [thread overview]
Message-ID: <760ee963ce814021ab64e1ec9fee6477@AcuMS.aculab.com> (raw)
In-Reply-To: <CAHk-=wiyeMKrvU5GdjekSF65KS=i3hKzfJ1qe2Xja42K+qOd2w@mail.gmail.com>
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)
next prev parent reply other threads:[~2023-08-09 9:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-06 23:06 [PATCH] fs: use __fput_sync in close(2) Mateusz Guzik
2023-08-07 3:18 ` Matthew Wilcox
2023-08-08 5:56 ` Eric W. Biederman
2023-08-08 7:32 ` Mateusz Guzik
2023-08-08 8:13 ` Christian Brauner
2023-08-08 8:23 ` Mateusz Guzik
2023-08-08 8:40 ` Christian Brauner
2023-08-08 9:21 ` Mateusz Guzik
2023-08-08 15:07 ` [PATCH v2 (kindof)] " Mateusz Guzik
2023-08-08 16:30 ` Christian Brauner
2023-08-08 17:00 ` Christian Brauner
2023-08-08 17:05 ` Linus Torvalds
2023-08-08 17:06 ` Christian Brauner
2023-08-09 9:03 ` David Laight [this message]
2023-08-08 16:57 ` [PATCH] " Linus Torvalds
2023-08-08 17:10 ` Mateusz Guzik
2023-08-08 17:18 ` Linus Torvalds
2023-08-08 17:24 ` Mateusz Guzik
2023-08-08 17:35 ` Christian Brauner
2023-08-08 17:48 ` Linus Torvalds
2023-08-08 17:15 ` Christian Brauner
2023-08-08 17:22 ` Linus Torvalds
2023-08-08 17:48 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=760ee963ce814021ab64e1ec9fee6477@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=brauner@kernel.org \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.