From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D426C433EF for ; Tue, 19 Apr 2022 21:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345951AbiDSVa2 (ORCPT ); Tue, 19 Apr 2022 17:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346877AbiDSVa0 (ORCPT ); Tue, 19 Apr 2022 17:30:26 -0400 Received: from nibbler.cm4all.net (nibbler.cm4all.net [82.165.145.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C8539827 for ; Tue, 19 Apr 2022 14:27:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by nibbler.cm4all.net (Postfix) with ESMTP id 651FAC00E1 for ; Tue, 19 Apr 2022 23:27:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at nibbler.cm4all.net Received: from nibbler.cm4all.net ([127.0.0.1]) by localhost (nibbler.cm4all.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cQgGUAjwsX4n for ; Tue, 19 Apr 2022 23:27:33 +0200 (CEST) Received: from zero.intern.cm-ag (zero.intern.cm-ag [172.30.16.10]) by nibbler.cm4all.net (Postfix) with SMTP id 479E3C00CB for ; Tue, 19 Apr 2022 23:27:33 +0200 (CEST) Received: (qmail 17150 invoked from network); 20 Apr 2022 03:17:38 +0200 Received: from unknown (HELO rabbit.intern.cm-ag) (172.30.3.1) by zero.intern.cm-ag with SMTP; 20 Apr 2022 03:17:38 +0200 Received: by rabbit.intern.cm-ag (Postfix, from userid 1023) id 1563E460F19; Tue, 19 Apr 2022 23:27:33 +0200 (CEST) Date: Tue, 19 Apr 2022 23:27:33 +0200 From: Max Kellermann To: David Howells Cc: Max Kellermann , linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: fscache corruption in Linux 5.17? Message-ID: References: <507518.1650383808@warthog.procyon.org.uk> <509961.1650386569@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <509961.1650386569@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/04/19 18:42, David Howells 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