Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp961418pxb; Fri, 22 Apr 2022 15:23:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAtgdXIoF2wvbz53OYdUUWIbLHNC49aByaNfsvAjTYfflviE/XfXOkXwk8UiVNrWb0ubCV X-Received: by 2002:a63:34c:0:b0:3aa:51b6:8f17 with SMTP id 73-20020a63034c000000b003aa51b68f17mr5737721pgd.218.1650666237607; Fri, 22 Apr 2022 15:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650666237; cv=none; d=google.com; s=arc-20160816; b=D1ZvO9B0ba02nxoU/Qr3GDXpjbVdINrG/IK3TY2lJTL1DWtesz040gN9I8BeUNBaIN lNccrgxF73/y1Gk8G1FJl2giPKkDA48s9HlpmP1xoi/LDxK4fjrphUH9r3W4nlKw0ij/ Tcxbjiq9LDuTbMz4V+bYY3MGMCN/IJ688gAls7ohSeeA3aGduxXzToEsXp0YiCkJhPF+ YOdDa6NBITzXW1X3/vseblOZom4ZQx2ucuU1rFprMyiHxM/yBHUtLPKc4DWqEP3Oh9Nm 9unTqGj+ksO8g7cdKxbPjMy581UBC1xqhFJS2aq+X6ZET9ycu9Z/uJq/+mXoZ78Nwxmq VCAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lqxSKTxr67s58F3qyK3MAxyhDd19e1d/EUd+379XVGM=; b=aCBvq7gzYoM9aBUxWF0HcoNxQbkRTfJG9H9z+Pa3LUbyDYyYPfCcSJPM4tyh+YfiuN qGtTrQAD/rrdHagAf7zGEPXxp5hZ03iLH9RKdGrMn9QleMAZaPIRLOqjBxZKDMGD7+j8 7au/z6Uhrv18NQiP5JP+csd0GYdW4hZR5rkev2wyCNiNCFsW4tlbDeEQhKgQafRw1WxC XR0XoW6EZZ9Vba8rcCn14LWKaQmUH7/EXWL6D8D3kDvo12ncFB7sW/fp/VuRMc4+BvZA t7i61Gv0XJVWYM+nQ7chyK3UjKjsqd2qnPl+YD0BuJ+U870wLYYn5NXUC1VOvApLfPNc eWsg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h8-20020a170902b94800b0015cdf42aa10si968417pls.548.2022.04.22.15.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:23:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 870AD2C334C; Fri, 22 Apr 2022 13:29:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357992AbiDSVa2 (ORCPT + 99 others); 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> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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