From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] pidfd updates
Date: Tue, 25 Apr 2023 14:08:54 +0200 [thread overview]
Message-ID: <20230425-sardinen-bespannt-c19a6bb8e74e@brauner> (raw)
In-Reply-To: <CAHk-=wgFt+rPoEH1bPG2A9K3GNebraLNcbnDiKK=Wp0i6D_0Ww@mail.gmail.com>
On Mon, Apr 24, 2023 at 01:35:03PM -0700, Linus Torvalds wrote:
> On Mon, Apr 24, 2023 at 1:24 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > But I really think a potentially much nicer model would have been to
> > extend our "get_unused_fd_flags()" model.
> >
> > IOW, we could have instead marked the 'struct file *' in the file
> > descriptor table as being "not ready yet".
>
> Maybe that isn't worth it just for pdfd, but I have this feeling that
> it might make some other code simpler too.
>
> That pidfd case isn't the only one that has to carry both a file
> pointer and a fd around.
>
> Looking around, I get the feeling that quite a lot of users of
> "fd_install()" might actually have been happier if they could just
> install it early, and then just have a "fd_expose(fd)" for the success
> case, and for the error cases have "put_unused_fd(fd)" also do the
> fput on the file descriptor even if the low bit was set. One less
> thing to worry about.
>
> I dunno. Maybe not worth it. That "two return values" just made me go "Eww".
I'm not fond of "two return values" - in C at least - as well I think
open-coding get_unused_fd() is pretty nasty as well...
Let me see...
next prev parent reply other threads:[~2023-04-25 12:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 13:41 [GIT PULL] pidfd updates Christian Brauner
2023-04-24 20:24 ` Linus Torvalds
2023-04-24 20:35 ` Linus Torvalds
2023-04-25 12:08 ` Christian Brauner [this message]
2023-04-25 6:04 ` Al Viro
2023-04-25 12:34 ` Christian Brauner
2023-04-25 13:54 ` Al Viro
2023-04-25 14:36 ` Christian Brauner
2023-04-25 15:48 ` Al Viro
2023-04-25 16:28 ` Linus Torvalds
2023-04-25 17:19 ` Al Viro
2023-04-28 8:40 ` David Laight
2023-04-28 18:26 ` Linus Torvalds
2023-04-27 1:07 ` Al Viro
2023-04-27 7:39 ` Al Viro
2023-04-27 8:33 ` Christian Brauner
2023-04-27 8:59 ` Al Viro
2023-04-27 9:40 ` Christian Brauner
2023-04-27 15:21 ` Linus Torvalds
2023-04-27 17:02 ` Al Viro
2023-05-02 7:11 ` Christian Brauner
2023-04-27 8:11 ` Christian Brauner
2023-04-24 21:45 ` pr-tracker-bot
-- strict thread matches above, loose matches on Subject: below --
2021-11-10 14:52 Christian Brauner
2021-11-11 0:25 ` pr-tracker-bot
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=20230425-sardinen-bespannt-c19a6bb8e74e@brauner \
--to=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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.