From: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
To: Bernd Schubert <bernd.schubert@fastmail.fm>,
Miklos Szeredi <miklos@szeredi.hu>
Cc: Jonathan Corbet <corbet@lwn.net>,
linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, me@jcix.top
Subject: Re: [PATCH 4/5] fuse: writeback_cache consistency enhancement (writeback_cache_v2)
Date: Wed, 23 Aug 2023 18:59:49 +0800 [thread overview]
Message-ID: <029cb695-9b8e-8fb3-ef0f-b223f34e7639@bytedance.com> (raw)
In-Reply-To: <699673a6-ff82-8968-6310-9a0b1c429be3@fastmail.fm>
On 2023/8/23 18:35, Bernd Schubert wrote:
> On 8/23/23 11:07, Miklos Szeredi wrote:
>> On Tue, 11 Jul 2023 at 06:36, Jiachen Zhang
>> <zhangjiachen.jaycee@bytedance.com> wrote:
>>>
>>> Some users may want both the high performance of the writeback_cahe mode
>>> and a little bit more consistency among FUSE mounts. Current
>>> writeback_cache mode never updates attributes from server, so can never
>>> see the file attributes changed by other FUSE mounts, which means
>>> 'zero-consisteny'.
>>>
>>> This commit introduces writeback_cache_v2 mode, which allows the
>>> attributes
>>> to be updated from server to kernel when the inode is clean and no
>>> writeback is in-progressing. FUSE daemons can select this mode by the
>>> FUSE_WRITEBACK_CACHE_V2 init flag.
>>>
>>> In writeback_cache_v2 mode, the server generates official attributes.
>>> Therefore,
>>>
>>> 1. For the cmtime, the cmtime generated by kernel are just
>>> temporary
>>> values that are never flushed to server by fuse_write_inode(),
>>> and they
>>> could be eventually updated by the official server cmtime. The
>>> mtime-based revalidation of the fc->auto_inval_data mode is also
>>> skipped, as the kernel-generated temporary cmtime are likely not
>>> equal
>>> to the offical server cmtime.
>>>
>>> 2. For the file size, we expect server updates its file size on
>>> FUSE_WRITEs. So we increase fi->attr_version in
>>> fuse_writepage_end() to
>>> check the staleness of the returning file size.
>>>
>>> Together with FOPEN_INVAL_ATTR, a FUSE daemon is able to implement
>>> close-to-open (CTO) consistency like NFS client implementations.
>>
>> What I'd prefer is mode similar to NFS: getattr flushes pending writes
>> so that server ctime/mtime are always in sync with client. FUSE
>> probably should have done that from the beginning, but at that time I
>> wasn't aware of the NFS solution.
>
>
> I think it would be good to have flush-on-getattr configurable - systems
> with a distributed lock manager (DLM) and notifications from
> server/daemon to kernel should not need it.
>
>
> Thanks,
> Bernd
Hi Miklos and Bernd,
I agree that flush-on-getattr is a good solution to keep the c/mtime
consistency for the view of userspace applications.
Maybe in the next version, we can add the flush-on-getattr just for the
writeback_cache_v2 mode, as daemons replying on reverse notifications
are likely not need the writeback_cache_v2 mode. What do you think?
Thanks,
Jiachen
next prev parent reply other threads:[~2023-08-23 10:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 4:34 [PATCH 0/5] FUSE consistency improvements Jiachen Zhang
2023-07-11 4:34 ` [PATCH 1/5] fuse: check attributes staleness on fuse_iget() Jiachen Zhang
2023-08-23 8:57 ` Miklos Szeredi
2023-07-11 4:34 ` [PATCH 2/5] fuse: invalidate dentry on EEXIST creates or ENOENT deletes Jiachen Zhang
2023-08-16 12:27 ` Miklos Szeredi
2023-07-11 4:34 ` [PATCH 3/5] fuse: add FOPEN_INVAL_ATTR Jiachen Zhang
2023-08-23 9:01 ` Miklos Szeredi
2023-08-23 11:12 ` Jiachen Zhang
2023-07-11 4:34 ` [PATCH 4/5] fuse: writeback_cache consistency enhancement (writeback_cache_v2) Jiachen Zhang
2023-08-23 9:07 ` Miklos Szeredi
2023-08-23 10:35 ` Bernd Schubert
2023-08-23 10:59 ` Jiachen Zhang [this message]
2023-08-23 22:55 ` Bernd Schubert
2023-07-11 4:34 ` [PATCH 5/5] docs: fuse: improve FUSE consistency explanation Jiachen Zhang
2023-07-11 4:42 ` Randy Dunlap
2023-07-11 7:15 ` Jiachen Zhang
2023-07-14 5:50 ` [PATCH 0/5] FUSE consistency improvements Jingbo Xu
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=029cb695-9b8e-8fb3-ef0f-b223f34e7639@bytedance.com \
--to=zhangjiachen.jaycee@bytedance.com \
--cc=bernd.schubert@fastmail.fm \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@jcix.top \
--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
all inboxes | Powered by JetHome®