From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:59156 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbdLDMRW (ORCPT ); Mon, 4 Dec 2017 07:17:22 -0500 Date: Mon, 4 Dec 2017 13:17:28 +0100 From: Greg KH To: NeilBrown Cc: Anna.Schumaker@Netapp.com, stable@vger.kernel.org Subject: Re: FAILED: patch "[PATCH] NFS: revalidate "." etc correctly on "open"." failed to apply to 3.18-stable tree Message-ID: <20171204121728.GG18589@kroah.com> References: <1511796032118218@kroah.com> <874lpdyh1w.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874lpdyh1w.fsf@notabene.neil.brown.name> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Nov 29, 2017 at 01:06:35PM +1100, NeilBrown wrote: > > Subject: [PATCH] NFS: revalidate "." etc correctly on "open". > > commit b688741cb06695312f18b730653d6611e1bad28d upstream. > > For correct close-to-open semantics, NFS must validate > the change attribute of a directory (or file) on open. > > Since commit ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a > d_weak_revalidate dentry op"), open() of "." or a path ending ".." is > not revalidated reliably (except when that direct is a mount point). > > Prior to that commit, "." was revalidated using nfs_lookup_revalidate() > which checks the LOOKUP_OPEN flag and forces revalidation if the flag is > set. > Since that commit, nfs_weak_revalidate() is used for NFSv3 (which > ignores the flags) and nothing is used for NFSv4. > > This is fixed by using nfs_lookup_verify_inode() in > nfs_weak_revalidate(). This does the revalidation exactly when needed. > Also, add a definition of .d_weak_revalidate for NFSv4. > > The incorrect behavior is easily demonstrated by running "echo *" in > some non-mountpoint NFS directory while watching network traffic. > Without this patch, "echo *" sometimes doesn't produce any traffic. > With the patch it always does. > > Fixes: ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op") > cc: stable@vger.kernel.org (3.9+) > Signed-off-by: NeilBrown > Signed-off-by: Anna Schumaker > --- > fs/nfs/dir.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > This version applies to 3.18.y 4.4.y and 4.9.y Thanks for the backport, now applied. greg k-h