]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Do not set NFS_INO_INVALID_LABEL unless server supports labeled NFS
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 6 Feb 2014 19:38:53 +0000 (14:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 06:06:10 +0000 (22:06 -0800)
commitfde4f2d2e1c2b7c1d7c0a9359f884293f8ec5a64
tree79c51ec0aa68c13cc25b5a9815efc5ba72a2151d
parent26154ff956fc591f4960c8d82707660f47749929
NFS: Do not set NFS_INO_INVALID_LABEL unless server supports labeled NFS

commit fd1defc257e2b12ab69bc0b379105c00eca4e112 upstream.

Commit aa9c2669626c (NFS: Client implementation of Labeled-NFS) introduces
a performance regression. When nfs_zap_caches_locked is called, it sets
the NFS_INO_INVALID_LABEL flag irrespectively of whether or not the
NFS server supports security labels. Since that flag is never cleared,
it means that all calls to nfs_revalidate_inode() will now trigger
an on-the-wire GETATTR call.

This patch ensures that we never set the NFS_INO_INVALID_LABEL unless the
server advertises support for labeled NFS.
It also causes nfs_setsecurity() to clear NFS_INO_INVALID_LABEL when it
has successfully set the security label for the inode.
Finally it gets rid of the NFS_INO_INVALID_LABEL cruft from nfs_update_inode,
which has nothing to do with labeled NFS.

Reported-by: Neil Brown <neilb@suse.de>
Tested-by: Neil Brown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/inode.c
fs/nfs/internal.h