[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260124165430.GT5966@frogsfrogsfrogs>
Date: Sat, 24 Jan 2026 08:54:30 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: Joanne Koong <joannelkoong@...il.com>
Cc: miklos@...redi.hu, bernd@...ernd.com, neal@...pa.dev,
linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 07/31] fuse: create a per-inode flag for toggling iomap
On Fri, Jan 23, 2026 at 10:05:32AM -0800, Joanne Koong wrote:
> On Thu, Jan 22, 2026 at 2:22 PM Darrick J. Wong <djwong@...nel.org> wrote:
> >
> > On Wed, Jan 21, 2026 at 05:13:39PM -0800, Joanne Koong wrote:
> > > On Tue, Oct 28, 2025 at 5:46 PM Darrick J. Wong <djwong@...nel.org> wrote:
> > > >
> > > > From: Darrick J. Wong <djwong@...nel.org>
> > > >
> > > > Create a per-inode flag to control whether or not this inode actually
> > > > uses iomap. This is required for non-regular files because iomap
> > > > doesn't apply there; and enables fuse filesystems to provide some
> > > > non-iomap files if desired.
> > > >
> > > > Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
> > >
> > > The logic in this makes sense to me, left just a few comments below.
> > >
> > > Reviewed-by: Joanne Koong <joannelkoong@...il.com>
> >
> > Thanks!
> >
> > > > ---
> > > > fs/fuse/fuse_i.h | 17 ++++++++++++++++
> > > > include/uapi/linux/fuse.h | 3 +++
> > > > fs/fuse/file.c | 1 +
> > > > fs/fuse/file_iomap.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
> > > > fs/fuse/inode.c | 26 ++++++++++++++++++------
> > > > 5 files changed, 90 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> > > > index f1ef77a0be05bb..42c85c19f3b13b 100644
> > > > --- a/fs/fuse/file.c
> > > > +++ b/fs/fuse/file.c
> > > > +void fuse_iomap_init_reg_inode(struct inode *inode, unsigned attr_flags)
> > > > +{
> > > > + struct fuse_conn *conn = get_fuse_conn(inode);
> > > > + struct fuse_inode *fi = get_fuse_inode(inode);
> > > > +
> > > > + ASSERT(S_ISREG(inode->i_mode));
> > > > +
> > > > + if (conn->iomap && (attr_flags & FUSE_ATTR_IOMAP)) {
> > > > + set_bit(FUSE_I_EXCLUSIVE, &fi->state);
> > > > + fuse_inode_set_iomap(inode);
> > > > + }
> > > > +}
> > > > +
> > > > +void fuse_iomap_evict_inode(struct inode *inode)
> > > > +{
> > > > + struct fuse_conn *conn = get_fuse_conn(inode);
> > > > + struct fuse_inode *fi = get_fuse_inode(inode);
> > > > +
> > > > + if (fuse_inode_has_iomap(inode))
> > >
> > > If I'm understanding this correctly, a fuse inode can't have
> > > FUSE_I_IOMAP set on it if conn>iomap is not enabled, correct?
> >
> > Correct.
> >
> > > Maybe it makes sense to just return if (!conn->iomap) at the very
> > > beginning, to make that more clear?
> >
> > <shrug> fuse_inode_has_iomap only checks FUSE_I_IOMAP...
> >
> > > > + fuse_inode_clear_iomap(inode);
> > > > + if (conn->iomap && fuse_inode_is_exclusive(inode))
> > > > + clear_bit(FUSE_I_EXCLUSIVE, &fi->state);
> >
> > ...but I wasn't going to assume that iomap is the only way that
> > FUSE_I_EXCLUSIVE could get set.
> >
> > On the other hand, for non-regular files we set FUSE_I_EXCLUSIVE only if
> > conn->iomap is nonzero *and* attr->flags contains FUSE_ATTR_IOMAP. So
> > this clearing code isn't quite the same as the setting code.
> >
> > I wonder if that means we should set FUSE_I_IOMAP for non-regular files?
> > They don't use iomap itself, but I suppose it would be neat if "iomap
> > directories" also meant that timestamps and whatnot worked in the same
> > as they do for regular files.
> >
>
> That seems like a good idea to me. I think that also makes the mental
> model (at least for me) simpler.
I tried that, and generic/476 immediately broke. I'll get back to that
next week, but turning it on unconditionally is not trivial
unfortunately. :/
--D
> Thanks,
> Joanne
Powered by blists - more mailing lists