linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Kellermann <mk@cm4all.com>
To: David Howells <dhowells@redhat.com>
Cc: Max Kellermann <mk@cm4all.com>,
	linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: fscache corruption in Linux 5.17?
Date: Tue, 19 Apr 2022 23:27:33 +0200	[thread overview]
Message-ID: <Yl8pRVSW9y1o6MBV@rabbit.intern.cm-ag> (raw)
In-Reply-To: <509961.1650386569@warthog.procyon.org.uk>

On 2022/04/19 18:42, David Howells <dhowells@redhat.com> wrote:
> Could the file have been modified by a third party?  If you're using NFS3
> there's a problem if two clients can modify a file at the same time.  The
> second write can mask the first write and the client has no way to detect it.
> The problem is inherent to the protocol design.  The NFS2 and NFS3 protocols
> don't support anything better than {ctime,mtime,filesize} - the change
> attribute only becomes available with NFS4.

I tried to write a script to stress-test writing and reading, but
found no clue so far.  I'll continue that tomorrow.

My latest theory is that this is a race condition; what if one process
writes to the file, which invalidates the cache; then, in the middle
of invalidating the local cache and sending the write to the NFS
server, another process (on the same server) reads the file; what
modification time and what data will it see?  What if the cache gets
filled with old data, while new data to-be-written is still in flight?

Max

  parent reply	other threads:[~2022-04-19 21:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 15:10 fscache corruption in Linux 5.17? Max Kellermann
2022-04-16 11:38 ` Thorsten Leemhuis
2022-04-16 19:55   ` Max Kellermann
2022-04-19 13:02 ` David Howells
2022-04-19 14:18   ` Max Kellermann
2022-04-19 15:23     ` [Linux-cachefs] " David Wysochanski
2022-04-19 16:17   ` David Howells
2022-04-19 16:41     ` Max Kellermann
2022-04-19 16:47     ` David Howells
2022-04-19 15:56 ` David Howells
2022-04-19 16:06   ` Max Kellermann
2022-04-19 16:42   ` David Howells
2022-04-19 18:01     ` Max Kellermann
2022-04-19 21:27     ` Max Kellermann [this message]
2022-04-20 13:55     ` David Howells
2022-05-04  8:38       ` Max Kellermann
2022-05-31  8:35       ` David Howells
2022-05-31  8:41         ` Max Kellermann
2022-05-31  9:13         ` David Howells
2022-06-20  7:11           ` Thorsten Leemhuis

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=Yl8pRVSW9y1o6MBV@rabbit.intern.cm-ag \
    --to=mk@cm4all.com \
    --cc=dhowells@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).