Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61beef75 authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust
Browse files

NFS: Clear up state owner lock usage



can_open_cached() reads values out of the state structure, meaning that
we need the so_lock to have a correct return value.  As a bonus, this
helps clear up some potentially confusing code.

Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 0f7a622c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1307,7 +1307,6 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
	int ret = -EAGAIN;

	for (;;) {
		if (can_open_cached(state, fmode, open_mode)) {
		spin_lock(&state->owner->so_lock);
		if (can_open_cached(state, fmode, open_mode)) {
			update_open_stateflags(state, fmode);
@@ -1315,7 +1314,6 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
			goto out_return_state;
		}
		spin_unlock(&state->owner->so_lock);
		}
		rcu_read_lock();
		delegation = rcu_dereference(nfsi->delegation);
		if (!can_open_delegated(delegation, fmode)) {