From: "Darrick J. Wong" <djwong@kernel.org>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC 8/8] xfs: use super write guard in xfs_file_ioctl()
Date: Wed, 5 Nov 2025 09:47:05 -0800 [thread overview]
Message-ID: <20251105174705.GB196358@frogsfrogsfrogs> (raw)
In-Reply-To: <20251104-mitglied-ozonwerte-88de46f0b26a@brauner>
On Tue, Nov 04, 2025 at 09:57:30PM +0100, Christian Brauner wrote:
> 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@kernel.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.
The wait_ macro would maintain sb_.*_write greppability, though I don't
know how important that might be.
--D
next prev parent reply other threads:[~2025-11-05 17:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 12:12 [PATCH RFC 0/8] fs: introduce super write guard Christian Brauner
2025-11-04 12:12 ` [PATCH RFC 1/8] fs: add super_write_guard Christian Brauner
2025-11-04 12:32 ` Jan Kara
2025-11-04 12:12 ` [PATCH RFC 2/8] btrfs: use super write guard in btrfs_reclaim_bgs_work() Christian Brauner
2025-11-04 20:42 ` Qu Wenruo
2025-11-05 16:33 ` Daniel Vacek
2025-11-04 12:12 ` [PATCH RFC 3/8] btrfs: use super write guard btrfs_run_defrag_inode() Christian Brauner
2025-11-05 16:38 ` Daniel Vacek
2025-11-06 8:19 ` David Sterba
2025-11-04 12:12 ` [PATCH RFC 4/8] btrfs: use super write guard in sb_start_write() Christian Brauner
2025-11-04 17:00 ` Mateusz Guzik
2025-11-04 20:56 ` Christian Brauner
2025-11-04 12:12 ` [PATCH RFC 5/8] ext4: use super write guard in write_mmp_block() Christian Brauner
2025-11-04 12:32 ` Jan Kara
2025-11-04 13:06 ` Theodore Ts'o
2025-11-05 18:33 ` Daniel Vacek
2025-11-06 9:24 ` Jan Kara
2025-11-06 10:04 ` Daniel Vacek
2025-11-04 12:12 ` [PATCH RFC 6/8] btrfs: use super write guard in relocating_repair_kthread() Christian Brauner
2025-11-04 12:12 ` [PATCH RFC 7/8] open: use super write guard in do_ftruncate() Christian Brauner
2025-11-04 12:32 ` Jan Kara
2025-11-05 18:37 ` Daniel Vacek
2025-11-04 12:12 ` [PATCH RFC 8/8] xfs: use super write guard in xfs_file_ioctl() Christian Brauner
2025-11-04 17:08 ` Darrick J. Wong
2025-11-04 20:57 ` Christian Brauner
2025-11-05 17:47 ` Darrick J. Wong [this message]
2025-11-05 18:40 ` Daniel Vacek
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=20251105174705.GB196358@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).