[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOQ4uxhw2Tc4YXwhkS=5EVC3Tg4F+QyrA7LE3V29pNhQ4WJeyA@mail.gmail.com>
Date: Tue, 4 Nov 2025 10:45:36 +0100
From: Amir Goldstein <amir73il@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-aio@...ck.org,
linux-unionfs@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
samba-technical@...ts.samba.org, cgroups@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 14/16] act: use credential guards in acct_write_process()
On Tue, Nov 4, 2025 at 12:04 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Mon, 3 Nov 2025 at 20:27, Christian Brauner <brauner@...nel.org> wrote:
> >
> > /* Perform file operations on behalf of whoever enabled accounting */
> > - cred = override_creds(file->f_cred);
> > -
> > + with_creds(file->f_cred);
>
> I'd almost prefer if we *only* did "scoped_with_creds()" and didn't
> have this version at all.
>
> Most of the cases want that anyway, and the couple of plain
> "with_creds()" cases look like they would only be cleaned up by making
> the cred scoping more explicit.
>
> What do you think?
I had a similar reaction but for another reason.
The 'with' lingo reminds me of python with statement (e.g.
with open_file('example.txt', 'w') as file:), which implies a scope.
So in my head I am reading "with_creds" as with_creds_do.
Add to that the dubious practice (IMO) of scoped statements
without an explicit {} scope and this can become a source of
human brainos, but maybe the only problematic brain is mine..
Thanks,
Amir.
Powered by blists - more mailing lists