[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251104-mitglied-ozonwerte-88de46f0b26a@brauner>
Date: Tue, 4 Nov 2025 21:57:30 +0100
From: Christian Brauner <brauner@...nel.org>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-fsdevel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, linux-btrfs@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org
Subject: Re: [PATCH RFC 8/8] xfs: use super write guard in xfs_file_ioctl()
On Tue, Nov 04, 2025 at 09:08:45AM -0800, Darrick J. Wong wrote:
> On Tue, Nov 04, 2025 at 01:12:37PM +0100, Christian Brauner wrote:
> > Signed-off-by: Christian Brauner <brauner@...nel.org>
> > ---
> > fs/xfs/xfs_ioctl.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> > index a6bb7ee7a27a..f72e96f54cb5 100644
> > --- a/fs/xfs/xfs_ioctl.c
> > +++ b/fs/xfs/xfs_ioctl.c
> > @@ -1408,10 +1408,8 @@ xfs_file_ioctl(
> >
> > trace_xfs_ioc_free_eofblocks(mp, &icw, _RET_IP_);
> >
> > - sb_start_write(mp->m_super);
> > - error = xfs_blockgc_free_space(mp, &icw);
> > - sb_end_write(mp->m_super);
> > - return error;
> > + scoped_guard(super_write, mp->m_super)
> > + return xfs_blockgc_free_space(mp, &icw);
>
> Can we go full on Java?
>
> #define with_sb_write(sb) scoped_guard(super_write, (sb))
>
> with_sb_write(mp->m_super)
> return xfs_blockgc_free_space(mp, &icw);
>
> I still keep seeing scoped_guard() as a function call, not the sort of
> thing that starts a new block.
>
> [If I missed the bikeshedding war over this, I'll let this go]
It's an option and what I did for the creds stuff. The thing is thought
that scoped_guard() is more widespread by now and thus probably easier
to grasp for readers that are familiar with it. I'm not married to it.
Powered by blists - more mailing lists