From: Dave Chinner <david@fromorbit.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
josef@toxicpanda.com, kernel-team@fb.com, amir73il@gmail.com,
linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v6 0/4] hide ->i_state behind accessors
Date: Tue, 23 Sep 2025 23:16:59 +1000 [thread overview]
Message-ID: <aNKdy1vYsWoMvU3c@dread.disaster.area> (raw)
In-Reply-To: <20250923104710.2973493-1-mjguzik@gmail.com>
On Tue, Sep 23, 2025 at 12:47:06PM +0200, Mateusz Guzik wrote:
> First commit message quoted verbatim with rationable + API:
>
> [quote]
> Open-coded accesses prevent asserting they are done correctly. One
> obvious aspect is locking, but significantly more can checked. For
> example it can be detected when the code is clearing flags which are
> already missing, or is setting flags when it is illegal (e.g., I_FREEING
> when ->i_count > 0).
>
> Given the late stage of the release cycle this patchset only aims to
> hide access, it does not provide any of the checks.
>
> Consumers can be trivially converted. Suppose flags I_A and I_B are to
> be handled, then:
>
> state = inode->i_state => state = inode_state_read(inode)
> inode->i_state |= (I_A | I_B) => inode_state_set(inode, I_A | I_B)
> inode->i_state &= ~(I_A | I_B) => inode_state_clear(inode, I_A | I_B)
> inode->i_state = I_A | I_B => inode_state_assign(inode, I_A | I_B)
> [/quote]
>
> Right now this is one big NOP, except for READ_ONCE/WRITE_ONCE for every access.
>
> Given this, I decided to not submit any per-fs patches. Instead, the
> conversion is done in 2 parts: coccinelle and whatever which was missed.
>
> Generated against:
> https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs-6.18.inode.refcount.preliminaries
Much simpler and nicer than the earlier versions. Looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2025-09-23 13:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 10:47 [PATCH v6 0/4] hide ->i_state behind accessors Mateusz Guzik
2025-09-23 10:47 ` [PATCH v6 1/4] fs: provide accessors for ->i_state Mateusz Guzik
2025-09-23 10:47 ` [PATCH v6 2/4] Convert the kernel to use ->i_state accessors Mateusz Guzik
2025-09-23 10:47 ` [PATCH v6 3/4] Manual conversion of ->i_state uses Mateusz Guzik
2025-09-25 10:07 ` Mateusz Guzik
2025-09-29 9:30 ` Christian Brauner
2025-09-23 10:47 ` [PATCH v6 4/4] fs: make plain ->i_state access fail to compile Mateusz Guzik
2025-09-23 11:16 ` [PATCH v6 0/4] hide ->i_state behind accessors Jan Kara
2025-09-23 13:16 ` Dave Chinner [this message]
2025-09-29 9:30 ` Christian Brauner
2025-09-29 12:56 ` Mateusz Guzik
2025-10-06 11:38 ` Christian Brauner
2025-10-06 13:16 ` Mateusz Guzik
2025-10-07 11:07 ` Christian Brauner
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=aNKdy1vYsWoMvU3c@dread.disaster.area \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mjguzik@gmail.com \
--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).