Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp783605ybi; Thu, 30 May 2019 06:44:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfYVUUkawQx9vvUkvCiFYPMmETFKoS/jR6zmJqKG1g/C1U3pKE9dydajPhTSKwWjCXG4FQ X-Received: by 2002:a65:5688:: with SMTP id v8mr3841044pgs.138.1559223876014; Thu, 30 May 2019 06:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559223876; cv=none; d=google.com; s=arc-20160816; b=YkIPn0tbsCKY8quJ0lMCxylbhdfsc7BQQZBugUA4f7w2NeOS9rmZF4bUFAfTUfkh5e rcNhfMOB3vjAmkPA83YH63i0OeLob14f5pfFuWlHUKL4MN8Ek4Ohk91pl22TMAsmcLJL xXL1QCy8Dcp0SJip2ucfiEoIKgjJp0p3y62VVyGpNM390+NDuvElmxYwG6DDdNtJsrLg y6sHrsXJgBT2OFxUReBTxK2kRN09Moi5WTekzT3+kvNq9qnFFygXmhBeRjOdIsIOo8lW 63w7ISyen8zXQrtw/HzCVajgZdSt3WvBV5QIavdrpuxFU9nVImnt8qCaD5WMOfJxyDm8 //YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=yc+7x8vqIuUTGyKq8UfcQWZh3ep6Fs7r8lnph+qqpf0=; b=NMkxRQ9Pf0n7x8ErW0yxVfbdvk9M3lzkxzcZV8rXT7+W+iEUVGTfchZqG3F69HeSLv Qu0qjF1LPL/pIvKfT/yBhaZxB8ogMj3KCzEb67beN01Ujwy67Or9hJVxXorrH0sUJMH9 r/aVL/zASRx61/QiUce9RiiARS5kH9l5CMW2M4fdPdAlmRz6+sKhkSRq3y1Cz2l/oxO/ solSU3QIOqEquiKBCjU3mAGVeIn0dbLTsAWOUtAD1naWSdrKdJbmzABUNrcIQN8zKE1A i0ABcMC333DRqqavN3jAbK7uKrYIYRB4hmKbV8h3aXJC6WfI5jDyKWHakq8l+TFFVcAV fzNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si549788plr.179.2019.05.30.06.44.07; Thu, 30 May 2019 06:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbfE3NoF (ORCPT + 99 others); Thu, 30 May 2019 09:44:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53088 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfE3NoF (ORCPT ); Thu, 30 May 2019 09:44:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F090307D915; Thu, 30 May 2019 13:44:05 +0000 (UTC) Received: from [10.10.66.66] (ovpn-66-66.rdu2.redhat.com [10.10.66.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBF165D704; Thu, 30 May 2019 13:44:04 +0000 (UTC) From: "Benjamin Coddington" To: "Trond Myklebust" Cc: linux-nfs@vger.kernel.org Subject: Re: client lookup_revalidate bug Date: Thu, 30 May 2019 09:44:03 -0400 Message-ID: <19F37AE9-C66F-4F2A-9048-ADC6021B1148@redhat.com> In-Reply-To: <30D343CF-50AD-4470-84D5-C825EB00B5C9@redhat.com> References: <458733948202ed0fddf37cbb79730b5ebdabd551.camel@hammerspace.com> <66FFF553-5DEE-4B49-A207-7B0D63FBAECB@redhat.com> <30D343CF-50AD-4470-84D5-C825EB00B5C9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 30 May 2019 13:44:05 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 30 May 2019, at 6:35, Benjamin Coddington wrote: > On 29 May 2019, at 13:19, Trond Myklebust wrote: >> On Wed, 2019-05-29 at 12:39 -0400, Benjamin Coddington wrote: >>> On 29 May 2019, at 12:21, Trond Myklebust wrote: >> >> Sorry, but that's not the case, because of the abuse of the >> nosharecache flag. You are manipulating the file on the server and >> expecting an immediate cache invalidation. That would require >> information that the client does not have. > > Yes, forget about the nosharecache flag. Let's just assume we move > the file > on the server. The client does perform a GETATTR and sees the updated > change_attr for the directory, but it matches the dentry's new d_time. > > I don't expect immediate cache invalidation; invalidation will never > happen > as long as B/'s change_attr isn't bumped again. On the client, B/foo > dentry's d_time is the same as the change_attr for B/, and even though > there's no file at B/foo on the server, the client will keep the B/foo > dentry until something else bumps B/'s change_attr. > > Maybe I need to imagine a scenario where this matters more.. > > But, I think that if we use the method of comparing d_time with the > parent's > change_attr to determine if we need to lookup, this is a case where > that's > not reliable. > > I'll try to come up with something as I have time to work on it since > I am > getting pressure about it. It looks to me like this behavior has been > around for a long time. Thanks for the look. Takayuki Nagata points out that this behavior only happens when we have a read delegation, and it seems obvious that we ought to skip lookup revalidation if so. Let me see if I can clarify the order of events so anyone that wishes can better argue about what should happen. Single client, NFS is mounted on /mnt Client reads /mnt/A/foo, dentry A/foo is hashed. Client moves /mnt/A/foo to /mnt/B/foo, dentry B/foo is hashed. Server moves B/foo back to A/foo. Client reads A/foo, gets a read delegation. Client looks up B/foo, skips revalidation because it holds the read delegation. Client will always return a positive lookup for both A/foo and B/foo at this point. Should this happen? My position is no, it shouldn't.