]> git.baikalelectronics.ru Git - kernel.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)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 10 Feb 2014 13:44:12 +0000 (08:44 -0500)
commitda6959ad54bc8c7460a3d73debc0ef39d4d6c233
treef0058b38b262aacd30da1ac5e4e85fb37451f559
parent5be6c96b0213ddc8bece5d066b36639b99a8bc26
NFS: Do not set NFS_INO_INVALID_LABEL unless server supports labeled NFS

Commit aa87ef371e2a (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>
Cc: stable@vger.kernel.org # 3.11+
Tested-by: Neil Brown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/inode.c
fs/nfs/internal.h