diff options
author | NeilBrown <neilb@suse.com> | 2017-08-25 17:34:41 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-30 08:40:46 +0000 |
commit | 5756707370240737fc8fca120c6e2b81c6b348c1 (patch) | |
tree | 0b238348976aa1083bf4487abdc1d9400b3fc80f /lib/reciprocal_div.c | |
parent | 2deb89453f74c576e145f4fd21664d175daf6bee (diff) | |
download | linux-stable-5756707370240737fc8fca120c6e2b81c6b348c1.tar.gz linux-stable-5756707370240737fc8fca120c6e2b81c6b348c1.tar.bz2 linux-stable-5756707370240737fc8fca120c6e2b81c6b348c1.zip |
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")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/reciprocal_div.c')
0 files changed, 0 insertions, 0 deletions