NFS: Fix dentry revalidation on NFSv4 lookup
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 27 Sep 2018 21:12:33 +0000 (17:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:30:51 +0000 (09:30 +0200)
commit01eea1cbba9d8309851f63356fa2f20a790af98f
tree2ee8259dffc592ae72bbf28df0eb4267ebd8f838
parent8a474bc4e6135cfdcd1573f0071e0b1b4318b307
NFS: Fix dentry revalidation on NFSv4 lookup

commit be189f7e7f03de35887e5a85ddcf39b91b5d7fc1 upstream.

We need to ensure that inode and dentry revalidation occurs correctly
on reopen of a file that is already open. Currently, we can end up
not revalidating either in the case of NFSv4.0, due to the 'cached open'
path.
Let's fix that by ensuring that we only do cached open for the special
cases of open recovery and delegation return.

Reported-by: Stan Hu <stanhu@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Qian Lu <luqia@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c