Linux filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: miklos@szeredi.hu, bernd@bsbernd.com, neal@gompa.dev,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 07/31] fuse: create a per-inode flag for toggling iomap
Date: Tue, 27 Jan 2026 15:33:37 -0800	[thread overview]
Message-ID: <20260127233337.GH5900@frogsfrogsfrogs> (raw)
In-Reply-To: <20260124165430.GT5966@frogsfrogsfrogs>

On Sat, Jan 24, 2026 at 08:54:30AM -0800, Darrick J. Wong wrote:
> 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@kernel.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@kernel.org> wrote:
> > > > >
> > > > > From: Darrick J. Wong <djwong@kernel.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@kernel.org>
> > > >
> > > > The logic in this makes sense to me, left just a few comments below.
> > > >
> > > > Reviewed-by: Joanne Koong <joannelkoong@gmail.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. :/

I've tentatively fixed this by defining a FUSE_ATTR_EXCLUSIVE flag in
the uapi so that the fuse server can tell the kernel which files are
"exclusive" files, and hence which ones should have FUSE_I_EXCLUSIVE
set.

(These are ofc files where the kernel can transmogrify ACLs into i_mode
changes and do ACL inheritance because there is no other principal that
could be writing to the ondisk metadata.)

--D

> --D
> 
> > Thanks,
> > Joanne
> 

  reply	other threads:[~2026-01-27 23:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251029002755.GK6174@frogsfrogsfrogs>
     [not found] ` <176169810144.1424854.11439355400009006946.stgit@frogsfrogsfrogs>
     [not found]   ` <176169810371.1424854.3010195280915622081.stgit@frogsfrogsfrogs>
2026-01-21 19:34     ` [PATCH 01/31] fuse: implement the basic iomap mechanisms Joanne Koong
2026-01-21 22:45       ` Darrick J. Wong
2026-01-22  0:06         ` Joanne Koong
2026-01-22  0:34           ` Darrick J. Wong
2026-02-05 19:22     ` Chris Mason
2026-02-05 23:31       ` Darrick J. Wong
     [not found]   ` <176169810415.1424854.10373764649459618752.stgit@frogsfrogsfrogs>
2026-01-21 23:42     ` [PATCH 03/31] fuse: make debugging configurable at runtime Joanne Koong
2026-01-22  0:02       ` Darrick J. Wong
2026-01-22  0:23         ` Joanne Koong
2026-01-22  0:40           ` Darrick J. Wong
     [not found]   ` <176169810502.1424854.13869957103489591272.stgit@frogsfrogsfrogs>
2026-01-22  1:13     ` [PATCH 07/31] fuse: create a per-inode flag for toggling iomap Joanne Koong
2026-01-22 22:22       ` Darrick J. Wong
2026-01-23 18:05         ` Joanne Koong
2026-01-24 16:54           ` Darrick J. Wong
2026-01-27 23:33             ` Darrick J. Wong [this message]
     [not found]   ` <176169810568.1424854.4073875923015322741.stgit@frogsfrogsfrogs>
2026-01-22  2:07     ` [PATCH 10/31] fuse: implement basic iomap reporting such as FIEMAP and SEEK_{DATA,HOLE} Joanne Koong
2026-01-22 22:31       ` Darrick J. Wong
     [not found]   ` <176169810612.1424854.16053093294573829123.stgit@frogsfrogsfrogs>
2026-01-23 18:56     ` [PATCH 12/31] fuse: implement direct IO with iomap Joanne Koong
2026-01-26 23:46       ` Darrick J. Wong
2026-02-05 19:19     ` Chris Mason
2026-02-06  2:08       ` Darrick J. Wong
2026-02-06  2:52         ` Chris Mason
2026-02-06  5:08           ` Darrick J. Wong
2026-02-06 14:27             ` Chris Mason
     [not found]   ` <176169810700.1424854.5753715202341698632.stgit@frogsfrogsfrogs>
2026-01-23 21:50     ` [PATCH 16/31] fuse: implement large folios for iomap pagecache files Joanne Koong
     [not found]   ` <176169810721.1424854.6150447623894591900.stgit@frogsfrogsfrogs>
2026-01-26 22:03     ` [PATCH 17/31] fuse: use an unrestricted backing device with iomap pagecache io Joanne Koong
2026-01-26 23:55       ` Darrick J. Wong
2026-01-27  1:35         ` Joanne Koong
2026-01-27  2:09           ` Darrick J. Wong
2026-01-27 18:04             ` Joanne Koong
2026-01-27 23:37               ` Darrick J. Wong
2026-01-27  0:59   ` [PATCHSET v6 4/8] fuse: allow servers to use iomap for better file IO performance Joanne Koong
2026-01-27  2:22     ` Darrick J. Wong
2026-01-27 19:47       ` Joanne Koong
2026-01-27 23:21         ` Darrick J. Wong
2026-01-28  0:10           ` Joanne Koong
2026-01-28  0:34             ` Darrick J. Wong
2026-01-29  1:12               ` Joanne Koong
2026-01-29 20:02                 ` Darrick J. Wong
2026-01-29 22:41                   ` Darrick J. Wong
2026-01-29 22:50                   ` Joanne Koong
2026-01-29 23:12                     ` Darrick J. Wong
     [not found]   ` <176169810980.1424854.10557015500766654898.stgit@frogsfrogsfrogs>
2026-02-05 18:57     ` [PATCH 29/31] fuse: disable direct reclaim for any fuse server that uses iomap Chris Mason
2026-02-06  4:25       ` Darrick J. Wong
     [not found]   ` <176169810874.1424854.5037707950055785011.stgit@frogsfrogsfrogs>
2026-02-05 19:01     ` [PATCH 24/31] fuse: implement inline data file IO via iomap Chris Mason
2026-02-06  2:27       ` Darrick J. Wong
     [not found]   ` <176169810765.1424854.10969346031644824992.stgit@frogsfrogsfrogs>
2026-02-05 19:07     ` [PATCH 19/31] fuse: query filesystem geometry when using iomap Chris Mason
2026-02-06  2:17       ` Darrick J. Wong
     [not found]   ` <176169810656.1424854.15239592653019383193.stgit@frogsfrogsfrogs>
2026-02-05 19:12     ` [PATCH 14/31] fuse: implement buffered IO with iomap Chris Mason
2026-02-06  2:14       ` Darrick J. Wong
     [not found]   ` <176169810634.1424854.13084435884326863405.stgit@frogsfrogsfrogs>
2026-02-05 19:16     ` [PATCH 13/31] fuse_trace: implement direct " Chris Mason
2026-02-06  2:12       ` Darrick J. Wong

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=20260127233337.GH5900@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=bernd@bsbernd.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neal@gompa.dev \
    /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