Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7797967ybl; Thu, 16 Jan 2020 05:51:49 -0800 (PST) X-Google-Smtp-Source: APXvYqy1vhRMN01qkE/G2nYq7l7crMUfo20O3pWIyK/Qfm0HBfe75VPuLo0TWIEv64EtxxFMgzSZ X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr1918576otc.337.1579182709185; Thu, 16 Jan 2020 05:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579182709; cv=none; d=google.com; s=arc-20160816; b=ajpddZpNPMd90pw2iWmTqbS9x8pdGGdLAF5SYxJ4loTOO9yPLnvJ498XgN2szhdeTE VLtE7wVZlDu6P/upB/43jhFtjTdzZbuCAWXU85GKgElmz6UF6cX6popw9PtRGJiKhmng B2FIMyxUomV8L+zleI7iDriWIK97z6FBG2Z0Lqv9x9WPd3xAtIk8mMjnqixKHsmyANml UJgAekYhVQMUgiQe+fcDL2ROs9uoWGmaNHhkyxmpeBnWF5yGi7MibMFw9fhhWI+sWxQc C5s11ummJHYaq/2lGsjgvdqVHzJGXIp9gafm5WBlmb/RW3c0YF8x2ta4RXUDofoLRkM5 TrQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Nbn+N57X58RnCPsb6V2BiTOHlhwM/BvJjY/VcPB+W8E=; b=rIvIOSYEPkOn7dEx3ImetHGz87Xth9ZvmhjFbVb6zEhmRV58BW9RSszSm0UMd9NcdZ C4epPHcjt1V6oblxB2IN49TEF13LqMy1KuJloU+uVUblEWQurbHiqKKJqjZzqVyX9Nh7 9eS17bG30yCq9DdgZkmVoPX+/HjHyKn0GQr3fCb8HnvkqlUyaeBPsge8xA2eRL2M6hTx ZKPLoQlV9a+N+S19grsv1JK/rgDZWWZBtmC9ytCk+9IALLVWotgVjGxLMGAoF2ycayZD GU6wTpW8suQNX6+GEN/1BH/eh2yibx0uljwAAwAYFXA2QwJwx1EYbbpVCD3Kk6BTgFMk mTtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MQBeyIMF; 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=pass (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 9si10305681oiz.237.2020.01.16.05.51.29; Thu, 16 Jan 2020 05:51:49 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MQBeyIMF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726406AbgAPNv1 (ORCPT + 99 others); Thu, 16 Jan 2020 08:51:27 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:40006 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726366AbgAPNv1 (ORCPT ); Thu, 16 Jan 2020 08:51:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579182686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Nbn+N57X58RnCPsb6V2BiTOHlhwM/BvJjY/VcPB+W8E=; b=MQBeyIMFG55/nVSbOlCM+N4KBNDgu4EyWAtf6Ao7oVBRL6IhCi+TBHJvYsneKtoBIEmsOi 3VaaGVn/Y8OOGjdBlBQkNB9IQxzuaZl/vWQLNL1Vb9hUUJx0TZ6nanDm8q2dbQ0HD1a1dq 2apjvWwet5fAPerNDpsC+0owTHr8D1s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-m0ghOif6MuqdSMZ-KLQjDA-1; Thu, 16 Jan 2020 08:51:24 -0500 X-MC-Unique: m0ghOif6MuqdSMZ-KLQjDA-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4891107ACC5; Thu, 16 Jan 2020 13:51:23 +0000 (UTC) Received: from [172.16.176.1] (ovpn-64-2.rdu2.redhat.com [10.10.64.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B0FE80A5C; Thu, 16 Jan 2020 13:51:23 +0000 (UTC) From: "Benjamin Coddington" To: "Trond Myklebust" Cc: linux-nfs@vger.kernel.org Subject: Lookup revalidation for OPEN_CLAIM_FH Date: Thu, 16 Jan 2020 08:51:22 -0500 Message-ID: <31B20BC3-A089-47F9-9821-7A3543FF7413@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Trond, I'd like to fix up lookup revalidation for v4.1+ when the client is using OPEN_CLAIM_FH. The fixes a while back for Stan Hu's case do not seem to improve things for v4.1, and actually make the behavior a bit worse since we no longer pass through nfs_lookup_verify_inode(), which would catch the cases where nlink == 0. Would you accept work to _always_ revalidate the dentry's parent for CLAIM_FH? Alternatively, it seems that CLAIM_NULL would be preferable for this case, though I don't know how the client would know when to decide between them. Here's a simple reproducer for convenience, I think we've already all agreed that the behavior we want is for the second open by `cat` to reflect the results of the move on the server, or at least eventually later opens would revalidate the dentry: #!/bin/bash set -o xtrace vers=4.1 exportfs -ua exportfs -o rw,sec=sys,no_root_squash *:/exports mkdir /mnt/localhost || true rm -f /exports/file{1,2} echo this is file 1 > /exports/file1 echo this is file 2 > /exports/file2 mount -t nfs -ov$vers,sec=sys localhost:/exports /mnt/localhost tail -f /mnt/localhost/file1 & sleep 1 # this is file 1 cat /mnt/localhost/file1 # overwrite the file on the server: mv -f /exports/file2 /exports/file1 # this is file 2 cat /mnt/localhost/file1 killall tail # this is file 2 cat /mnt/localhost/file1 umount /mnt/localhost Switching the $vers variable between v4.0 and v4.1 in this script shows the difference in behavior. Thanks for any advice, Ben