linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: miklos@szeredi.hu, brauner@kernel.org
Cc: djwong@kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@meta.com
Subject: [PATCH v2] fuse: keep inode->i_blkbits constant
Date: Thu,  7 Aug 2025 10:50:15 -0700	[thread overview]
Message-ID: <20250807175015.515192-1-joannelkoong@gmail.com> (raw)

With fuse now using iomap for writeback handling, inode blkbits changes
are problematic because iomap relies on inode->i_blkbits for its
internal bitmap logic. Currently we change inode->i_blkbits in fuse to
match the attr->blksize value passed in by the server.

This commit keeps inode->i_blkbits constant in fuse. Any attr->blksize
values passed in by the server will not update inode->i_blkbits. The
client-side behavior for stat is unaffected, stat will still reflect the
blocksize passed in by the server.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Fixes: ef7e7cbb32 ("fuse: use iomap for writeback")
---
Changelog:
v1: https://lore.kernel.org/linux-fsdevel/20250804210743.1239373-1-joannelkoong@gmail.com/#t
v1 -> v2:
  * Remove warning and keep stat() behavior unchanged (Miklos)
  * Dropped 2nd patch
---
 fs/fuse/inode.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index bfe8d8af46f3..33632c32ba6c 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -285,11 +285,6 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
 		}
 	}
 
-	if (attr->blksize != 0)
-		inode->i_blkbits = ilog2(attr->blksize);
-	else
-		inode->i_blkbits = inode->i_sb->s_blocksize_bits;
-
 	/*
 	 * Don't set the sticky bit in i_mode, unless we want the VFS
 	 * to check permissions.  This prevents failures due to the
-- 
2.47.3


             reply	other threads:[~2025-08-07 17:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07 17:50 Joanne Koong [this message]
2025-08-08 13:47 ` [PATCH v2] fuse: keep inode->i_blkbits constant Christian Brauner
2025-08-12  8:27 ` Miklos Szeredi
2025-08-12 16:58   ` Joanne Koong
2025-08-12 19:59   ` Darrick J. Wong
2025-08-12 20:44     ` Joanne Koong
2025-08-13  8:24       ` Miklos Szeredi
2025-08-14 16:45         ` 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=20250807175015.515192-1-joannelkoong@gmail.com \
    --to=joannelkoong@gmail.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).