Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp63074pxb; Fri, 5 Mar 2021 14:33:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQOajd/7uIReGyF7cMQJajXaNuBI6CtER29ktXnvylEwfpDKKhHRNGEPqYzYHHCyYX2KVY X-Received: by 2002:a17:906:2551:: with SMTP id j17mr4430214ejb.441.1614983588592; Fri, 05 Mar 2021 14:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614983588; cv=none; d=google.com; s=arc-20160816; b=kgRC5yfk6t3I+7LxocdGoYsjrCKmKNpF1pLSfgHP4SoKzf1hB1EsevdePB6emjM4EW pQc2oOJdlLKQ0hs/FYEudZRyAn4MTxMy62+WDW9pBfkJ8Wi/whSQ76zvUN5v30EyrA38 QQw8+Mwf3SfwllUwtNdIGPBZ3wXL9OLQ1it/d0XoSmfQ+hH+v/S1uaskEGtAA6qWkxz6 qOfohahC14HiMOtNjN9b9fXFIT3gTfWWXQvvpINM4V0dDyTAg3l1Ji57Thy6ZjKhx3X9 WMD5fORFCncb26OMuPMUAgiRbJCOA3JkJnnzk8XpUGcuFuhumviGQlHyca5pK5T3Esee JWFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=sH6z8qIu3yEmi//4fiqAw9bIiuJBOXiqL0KEvwTgvPY=; b=dmx1zNkqChEY0/ker/wnsZPSTjY9v9P1cPJyzI9OcwX6J6N9mbG7aCskS5BCkHASeL /3tLUFtAi/WLpncmHS5PvbrF3pVVFoGvjjzWU1isTYkENnvxBZxHr4QJb+bR4ITqukEV wsHRJghnr2innt/ESl93zPBRVgQvF4l4y0jQ64z+l/6dWuImJsAPADZvVCqtjyzKJh6h BE/NlAeMbx3uxI8PuyNqIibeWJw0tDRH7D9bYTcte5acjTNqsd0YGlLsUFWMbvE9R41V SpRUXpC8Zy5y4CI7idLYtL009rNXwpGhxNNZDIJNH51ZuhEvOVrPG5sMwdQm8IiE315H AxCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=LR0V4inc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ly3si2169173ejb.615.2021.03.05.14.32.35; Fri, 05 Mar 2021 14:33:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=LR0V4inc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbhCEWcA (ORCPT + 99 others); Fri, 5 Mar 2021 17:32:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhCEWbm (ORCPT ); Fri, 5 Mar 2021 17:31:42 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85296C06175F for ; Fri, 5 Mar 2021 14:31:42 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 717D125FE; Fri, 5 Mar 2021 17:31:41 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 717D125FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1614983501; bh=sH6z8qIu3yEmi//4fiqAw9bIiuJBOXiqL0KEvwTgvPY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LR0V4inc0W3QXs4r2KzPL9rXCpJH/UdPLe6JBKE6VLTu1ja1EKnc++i9vQuTpkUQf /zRkUXmP1zS8oRU/fNxuh+5diGQkZ+yigUmghVfv6lot3OxDDeDOW/U4HrW7PC+Ypk stHu2KwYIyr5smyBny7PdW/H+UdC9erSlj585kjI= Date: Fri, 5 Mar 2021 17:31:41 -0500 From: "J. Bruce Fields" To: Timo Rothenpieler Cc: Linux NFS Mailing List Subject: Re: NFSD Regression: client observing a file while other client writes to it leads to stale local cache Message-ID: <20210305223141.GD3813@fieldses.org> References: <20210301184633.GA14881@fieldses.org> <86ef3b71-bcb4-767c-40a0-461d082f5d44@rothenpieler.org> <20210302010629.GB16303@fieldses.org> <2d4e7965-903f-2319-d2d2-65116f50400c@rothenpieler.org> <20210304144228.GD17512@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210304144228.GD17512@fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Mar 04, 2021 at 09:42:28AM -0500, J. Bruce Fields wrote: > On Tue, Mar 02, 2021 at 02:23:05AM +0100, Timo Rothenpieler wrote: > > Server and reading client disagreeing about the files size and > > contents is 100% reproducible, even after the writing client has > > long and definitely closed the file. > > OK, I reproduced this myself and watched the network traffic in > Wireshark. > > The server is *not* giving out a read delegation to the writer (which is > what the commit you bisected to should have allowed). It *is* giving > out a delegation to the reader. Which is a truly awful bug. > Investigating.... Yeah, it's completely failing to provide close-to-open cache consistency there in most cases. Arghh. I have some idea how to fix it, but for now it should just be reverted. I'll post that pending some testing. I've also added a pynfs test for this case (4.1 test DELEG9). We should probably have some more. So, thanks for the report. I'd still be a little cautious about your use--NFS can't give you a lot of guarantees when you've got a file open for read and write simultaneously. The writing client can delay those writes at least until the writing application closes, and the reading isn't necessarily going to revalidate its cache until it the reading application closes and reopens. And weirder behavior is possible: for exapmle when the writer does write back, I don't think there's any guarantee it will write in order, so you could end up temporarily with NULLs in the middle. But that particular regression was my fault, thanks again for bisecting and reporting. --b.