From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4581A24677F; Sat, 24 Jan 2026 16:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769273671; cv=none; b=SGwWeZWa3+Fa21Lbjz9BTDHMPq+qFeMGcD+WaYlCImoRefgLSgKNPghzRUCO+YUVknYvfIc82ECJGs5wcDoB+2e5ErR0jS7qU4h3KJcl0va8rdBsv5Zo0V6n2qiHN65l/j1LWOiHlPfbMatz7XNzHo+nBo3EKHvQYNzx8B/5BbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769273671; c=relaxed/simple; bh=73Hqh12kK68g6ILOa04pwssPqLmn170Un7G0Rk25elo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pIZz2oa4JuHrAAT3XNd//U3+9weB+4ppWAelbxhPxM7mdTCRJetRrcsq1AJn+tzJn0A/o9D5VktYIRKlt5gsWhFuGq7kh0+UEU9Zae1PHmjp7GfHPKMG6NC+bxT4PZ139uQhUZ02wz2YZXWPoDLdpBWTQHaeTYhA2JuwxVEwZiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FfwvaTsZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FfwvaTsZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC262C116D0; Sat, 24 Jan 2026 16:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769273670; bh=73Hqh12kK68g6ILOa04pwssPqLmn170Un7G0Rk25elo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FfwvaTsZUkUFhdLfNWMPF6dIcza9h6DlSnXL4/7TvBnwk6a1iBNyJUJHKhkiOUd8T pCGieIXfDVmL4LqRW+GlmtQ+bCJpDB5TwlzumpBxDnDsR5uUSt7/CFmwJGhGUScDef Z2Eueh8uz5KTV40s962/AJauCHw8jpcLcvbHA3QbzjyLM0BfravdeiGe5F1CLO3PBG 7C6/hEeFCrZXpAYh+CMJxEvIS39Vj0wUHB8dGLt9Lg0Cru7i8lwY14J0mf3OtM2waE wnm9hRy7jhJzKMKr+YjrJMmOZRxPIw9Tdjf1c245q4QE9UV45/mwux+UzH45CvmpHe XHQDEVgh12Yng== Date: Sat, 24 Jan 2026 08:54:30 -0800 From: "Darrick J. Wong" To: Joanne Koong 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 Message-ID: <20260124165430.GT5966@frogsfrogsfrogs> References: <176169810144.1424854.11439355400009006946.stgit@frogsfrogsfrogs> <176169810502.1424854.13869957103489591272.stgit@frogsfrogsfrogs> <20260122222233.GA5900@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 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 wrote: > > > > > > > > From: Darrick J. Wong > > > > > > > > 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" > > > > > > The logic in this makes sense to me, left just a few comments below. > > > > > > Reviewed-by: Joanne Koong > > > > 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? > > > > 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