summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth.c
diff options
context:
space:
mode:
authorNeilBrown2014-07-14 03:28:20 +0200
committerTrond Myklebust2014-08-03 23:14:11 +0200
commitd51ac1a8e9b86b2d17d349bb256869cab6522787 (patch)
treeddb2dc1a448c67d512465eaee7c73cfdbbe4bf23 /net/sunrpc/auth.c
parentNFS: nfs4_lookup_revalidate: only evaluate parent if it will be used. (diff)
downloadkernel-qcow2-linux-d51ac1a8e9b86b2d17d349bb256869cab6522787.tar.gz
kernel-qcow2-linux-d51ac1a8e9b86b2d17d349bb256869cab6522787.tar.xz
kernel-qcow2-linux-d51ac1a8e9b86b2d17d349bb256869cab6522787.zip
NFS: prepare for RCU-walk support but pushing tests later in code.
nfs_lookup_revalidate, nfs4_lookup_revalidate, and nfs_permission all need to understand and handle RCU-walk for NFS to gain the benefits of RCU-walk for cached information. Currently these functions all immediately return -ECHILD if the relevant flag (LOOKUP_RCU or MAY_NOT_BLOCK) is set. This patch pushes those tests later in the code so that we only abort immediately before we enter rcu-unsafe code. As subsequent patches make that rcu-unsafe code rcu-safe, several of these new tests will disappear. With this patch there are several paths through the code which will no longer return -ECHILD during an RCU-walk. However these are mostly error paths or other uninteresting cases. A noteworthy change in nfs_lookup_revalidate is that we don't take (or put) the reference to ->d_parent when LOOKUP_RCU is set. Rather we rcu_dereference ->d_parent, and check that ->d_inode is not NULL. We also check that ->d_parent hasn't changed after all the tests. In nfs4_lookup_revalidate we simply avoid testing LOOKUP_RCU on the path that only calls nfs_lookup_revalidate() as that function already performs the required test. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc/auth.c')
0 files changed, 0 insertions, 0 deletions