From: "Darrick J. Wong" <djwong@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Joanne Koong <joannelkoong@gmail.com>,
brauner@kernel.org, linux-fsdevel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH v2] fuse: keep inode->i_blkbits constant
Date: Thu, 14 Aug 2025 09:45:39 -0700 [thread overview]
Message-ID: <20250814164539.GP7942@frogsfrogsfrogs> (raw)
In-Reply-To: <CAJfpeguN_Be4q0jxoS28zpd4Y8Ye6kqMhspAvJ=tuba97dPVVg@mail.gmail.com>
On Wed, Aug 13, 2025 at 10:24:36AM +0200, Miklos Szeredi wrote:
> On Tue, 12 Aug 2025 at 22:44, Joanne Koong <joannelkoong@gmail.com> wrote:
>
> > My understanding is that it's because in that path it uses cached stat
> > values instead of fetching with another statx call to the server so it
> > has to reflect the blocksize the server previously set. It took me a
> > while to realize that the blocksize the server reports to the client
> > is unrelated to whatever blocksize the kernel internally uses for the
> > inode since the kernel doesn't do any block i/o for fuse; the commit
> > message in commit 0e9663ee452ff ("fuse: add blksize field to
> > fuse_attr") says the blocksize attribute is if "the filesystem might
> > want to give a hint to the app about the optimal I/O size".
>
> Right, that's what POSIX says:
>
> st_blksize A file system-specific preferred I/O block size for
> this object. In some file system types, this may
> vary from file to file.
Ahahaha yes, I forgot about that. Regular filesystems can set i_blkbits
to whatever granularity they want and it persists until eviction, and if
they want to trick userspace they set st_blksize to something else.
Kind of like how XFS rounds that up to PAGE_SIZE for 1k fsblock
filesystems.
Now I see what Joanne meant about it taking a while to wrap her head
around i_blkbits vs. st_blksize. Thanks for pointing that out. :)
--D
> Thanks,
> Miklos
>
prev parent reply other threads:[~2025-08-14 16:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 17:50 [PATCH v2] fuse: keep inode->i_blkbits constant Joanne Koong
2025-08-08 13:47 ` 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 [this message]
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=20250814164539.GP7942@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=brauner@kernel.org \
--cc=joannelkoong@gmail.com \
--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