From: Josef Bacik <josef@toxicpanda.com>
To: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
kernel-team@meta.com, amir73il@gmail.com
Subject: Re: [PATCH] fuse: update size attr before doing IO
Date: Thu, 7 Mar 2024 11:09:02 -0500 [thread overview]
Message-ID: <20240307160902.GA2433926@perftesting> (raw)
In-Reply-To: <9d71a4fd1f1d8d4cfc28480f01e5fe3dc5a7e3f0.1709821568.git.sweettea-kernel@dorminy.me>
On Thu, Mar 07, 2024 at 10:08:13AM -0500, Sweet Tea Dorminy wrote:
> All calls into generic vfs functions need to make sure that the inode
> attributes used by those functions are up to date, by calling
> fuse_update_attributes() as appropriate.
>
> generic_write_checks() accesses inode size in order to get the
> appropriate file offset for files opened with O_APPEND. Currently, in
> some cases, fuse_update_attributes() is not called before
> generic_write_checks(), potentially resulting in corruption/overwrite of
> previously appended data if i_size is out of date in the cached inode.
>
> Therefore, make sure fuse_update_attributes() is always
> called before generic_write_checks(), and add a note about why it's not
> necessary for some llseek calls.
>
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
I had to ask questions and go look at the code, mostly because I'm not a FUSE
developer. fuse_update_attributes() doesn't actually do anything if the stats
aren't invalidated, I was concerned we were suddenly adding a lot of overhead
for every write call.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
I have a question for the normal FUSE developers, how would one test this?
There doesn't appear to be a mechanism for writing stub FUSE fs's to exercise a
case like this in fstests. Is there some other way you guys would test this or
is this something we need to build out ourselves? Thanks,
Josef
next prev parent reply other threads:[~2024-03-07 16:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 15:08 [PATCH] fuse: update size attr before doing IO Sweet Tea Dorminy
2024-03-07 16:09 ` Josef Bacik [this message]
2024-03-07 19:39 ` Bernd Schubert
2024-03-11 10:01 ` Miklos Szeredi
2024-03-12 18:18 ` Sweet Tea Dorminy
2024-03-12 21:55 ` Bernd Schubert
2024-03-12 23:08 ` Sweet Tea Dorminy
2024-03-14 10:26 ` Miklos Szeredi
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=20240307160902.GA2433926@perftesting \
--to=josef@toxicpanda.com \
--cc=amir73il@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=sweettea-kernel@dorminy.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.