summaryrefslogtreecommitdiffstats
path: root/crypto/rmd320.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-07-05 04:22:20 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-07-13 22:00:08 +0200
commitcc89684c9a265828ce061037f1f79f4a68ccd3f7 (patch)
tree8eb80f6fa20854f66e2c43a228a1bb5ea5c08288 /crypto/rmd320.c
parentPNFS for stateid errors retry against MDS first (diff)
downloadlinux-cc89684c9a265828ce061037f1f79f4a68ccd3f7.tar.xz
linux-cc89684c9a265828ce061037f1f79f4a68ccd3f7.zip
NFS: only invalidate dentrys that are clearly invalid.
Since commit bafc9b754f75 ("vfs: More precise tests in d_invalidate") in v3.18, a return of '0' from ->d_revalidate() will cause the dentry to be invalidated even if it has filesystems mounted on or it or on a descendant. The mounted filesystem is unmounted. This means we need to be careful not to return 0 unless the directory referred to truly is invalid. So -ESTALE or -ENOENT should invalidate the directory. Other errors such a -EPERM or -ERESTARTSYS should be returned from ->d_revalidate() so they are propagated to the caller. A particular problem can be demonstrated by: 1/ mount an NFS filesystem using NFSv3 on /mnt 2/ mount any other filesystem on /mnt/foo 3/ ls /mnt/foo 4/ turn off network, or otherwise make the server unable to respond 5/ ls /mnt/foo & 6/ cat /proc/$!/stack # note that nfs_lookup_revalidate is in the call stack 7/ kill -9 $! # this results in -ERESTARTSYS being returned 8/ observe that /mnt/foo has been unmounted. This patch changes nfs_lookup_revalidate() to only treat -ESTALE from nfs_lookup_verify_inode() and -ESTALE or -ENOENT from ->lookup() as indicating an invalid inode. Other errors are returned. Also nfs_check_inode_attributes() is changed to return -ESTALE rather than -EIO. This is consistent with the error returned in similar circumstances from nfs_update_inode(). As this bug allows any user to unmount a filesystem mounted on an NFS filesystem, this fix is suitable for stable kernels. Fixes: bafc9b754f75 ("vfs: More precise tests in d_invalidate") Cc: stable@vger.kernel.org (v3.18+) Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'crypto/rmd320.c')
0 files changed, 0 insertions, 0 deletions