Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp792127ybi; Fri, 14 Jun 2019 03:29:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxou1X0pLzPU1OeWXsJ03YmYHIUDavzuaA2QCvQYdEpzfC09BVie0lmC9CcmwdN9hBMDqrw X-Received: by 2002:a17:90a:b296:: with SMTP id c22mr10700740pjr.28.1560508162335; Fri, 14 Jun 2019 03:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560508162; cv=none; d=google.com; s=arc-20160816; b=KPv23SPbl5X4eEaybu/BCZqG1skxLmOTDAcUnOcG/4LRbI4qxta69MUE34lYtDgV5b 6eEfWYu3GeP4p6O7ARk9oD5RTBCsvghVPJSctc+YygHsQBE7VaPLcS9z51HSsIJ1o5WB r5FIr5KtPIoa/xGif5td46Qj7URyAO2CK1cJNNTfnPLcjso+5Kjz+Tt8Kft/mTBgwXvA RJrO++RIJKXCPdbDVLtmg2utD3jSNFYhHXI9sg8eep2C/eKQereq7zubypK0Qazuw2du GadipTehnNrm/mUu9R1Cq79QEL8M8jzcpUHnJjHmarN8Bqox9bh+LGjAeN+jHEO+8UPQ cFug== 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=ew5MuWBv8691p7dGZ2UvZ0SM99olUgA65wMdUaoTq8s=; b=IlewlzGLYXuEi4Df1hyhoL+4FS00SFyzn0IEM47HsCIAIjbxQzH97S5M4K89sLOY2N Bpv1R0rRHZiY5A8gum8dah0GCAVxmL57QDgBKa5q4g7RCr8WlDpUnN4qvmIbzQGCi4TN SX70ovOrwMIih5J5eK9VdC3feLPFtI/U9F0pZamPx/hSfjFYTgNBTQuZ6fU5bL65Pi7y 8/IhgeHbKCgcysvjiHeGjOs3wCivYxHZS5FO0BTDdD7x+vmwfW4p28k4oxrTzwi59HLL nLiL5JGFsgObaahEI6sUVScio40hS5OgNlQPYBSJpk26A4lMtPp4cn35Ur1fta6xp5Yv 80/Q== 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 r11si1965128pjq.108.2019.06.14.03.28.58; Fri, 14 Jun 2019 03:29:22 -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 S1726767AbfFNK2z (ORCPT + 99 others); Fri, 14 Jun 2019 06:28:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfFNK2z (ORCPT ); Fri, 14 Jun 2019 06:28:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 35C863091782; Fri, 14 Jun 2019 10:28:55 +0000 (UTC) Received: from [10.10.66.2] (ovpn-66-2.rdu2.redhat.com [10.10.66.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A85860495; Fri, 14 Jun 2019 10:28:53 +0000 (UTC) From: "Benjamin Coddington" To: "Olga Kornievskaia" Cc: "J. Bruce Fields" , trond.myklebust@hammerspace.com, "Anna Schumaker" , linux-nfs Subject: Re: [PATCH] NFS: Don't skip lookup when holding a delegation Date: Fri, 14 Jun 2019 06:28:55 -0400 Message-ID: <7A5AA6C0-CA02-49DD-8D80-066B0D83B2F2@redhat.com> In-Reply-To: References: <20190613145149.GD2145@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 14 Jun 2019 10:28:55 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 13 Jun 2019, at 12:02, Olga Kornievskaia wrote: > On Thu, Jun 13, 2019 at 11:00 AM J. Bruce Fields > wrote: >> >> On Wed, Jun 12, 2019 at 10:45:13AM -0400, Benjamin Coddington wrote: >>> If we skip lookup revalidation while holding a delegation, we might >>> miss >>> that the file has changed directories on the server. >> >> The delegation should prevent the file disappearing from this >> directory, >> so if I've been following the discussion, the bug was due to >> overlooking >> the case where the change happened before we got the delegation. >> Given >> that history it seems worth calling out that case specifically? >> >> Maybe a comment along the lines of: >> >> /* >> * Note that the file can't move while we hold a >> * delegation. But this dentry could have been >> cached >> * before we got a delegation. So it's only safe to >> * skip revalidation when the parent directory is >> * unchanged: >> */ >> >> But maybe there's a pithier way to say that. I wish I had pith. I cannot improve on this comment.. I'm OK with or without it. > What is preventing the file from disappearing from the directory while > holding the delegation: is it the server's responsibility to recall > the delegation when it gets a move or is it client's responsibility > not to rely on the cached attributes? The server should recall the delegation if the file moves, since moving it means that additional calls to OPEN that file at that location should fail. The client shouldn't continue to independently handle those OPENs (unless by filehandle.. but how can the server know how the client intends to handle further delegated OPENs?) > According to this patch it's client's responsibility, in the case, I > find the working " file can't move" confusing as they imply to me that > client can assume file isn't moved (ie, server will prevent it from > happening). I think that it looks like its the client's responsibility only because the client lacks an easy way to determine what order delegations were acquired with respect to directory modifications. We could try to track all of that, but the structures and memory used would be hideous. Ben