diff options
author | NeilBrown <neilb@suse.de> | 2014-07-14 11:28:20 +1000 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-03 17:14:12 -0400 |
commit | f3324a2a94c229831cfd42d871902cd4a9bd5e0f (patch) | |
tree | 287019bb1cce4518d714574bc224eba8a8ce098c /COPYING | |
parent | bd95608053b7f7813351b0defc0e3e7ef8cf2803 (diff) | |
download | blackbird-op-linux-f3324a2a94c229831cfd42d871902cd4a9bd5e0f.tar.gz blackbird-op-linux-f3324a2a94c229831cfd42d871902cd4a9bd5e0f.zip |
NFS: support RCU_WALK in nfs_permission()
nfs_permission makes two calls which are not always safe in RCU_WALK,
rpc_lookup_cred and nfs_do_access.
The second can easily be made rcu-safe by aborting with -ECHILD before
making the RPC call.
The former can be made rcu-safe by calling rpc_lookup_cred_nonblock()
instead.
As this will almost always succeed, we use it even when RCU_WALK
isn't being used as it still saves some spinlocks in a common case.
We only fall back to rpc_lookup_cred() if rpc_lookup_cred_nonblock()
fails and MAY_NOT_BLOCK isn't set.
This optimisation (always trying rpc_lookup_cred_nonblock()) is
particularly important when a security module is active.
In that case inode_permission() may return -ECHILD from
security_inode_permission() even though ->permission() succeeded in
RCU_WALK mode.
This leads to may_lookup() retrying inode_permission after performing
unlazy_walk(). The spinlock that rpc_lookup_cred() takes is often
more expensive than anything security_inode_permission() does, so that
spinlock becomes the main bottleneck.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions