Skip to content

Commit 043862b

Browse files
committed
NFSD: Add documenting comment for nfsd4_release_lockowner()
And return explicit nfserr values that match what is documented in the new comment / API contract. Signed-off-by: Chuck Lever <[email protected]>
1 parent bd8fdb6 commit 043862b

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

fs/nfsd/nfs4state.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7524,6 +7524,23 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)
75247524
return status;
75257525
}
75267526

7527+
/**
7528+
* nfsd4_release_lockowner - process NFSv4.0 RELEASE_LOCKOWNER operations
7529+
* @rqstp: RPC transaction
7530+
* @cstate: NFSv4 COMPOUND state
7531+
* @u: RELEASE_LOCKOWNER arguments
7532+
*
7533+
* The lockowner's so_count is bumped when a lock record is added
7534+
* or when copying a conflicting lock. The latter case is brief,
7535+
* but can lead to fleeting false positives when looking for
7536+
* locks-in-use.
7537+
*
7538+
* Return values:
7539+
* %nfs_ok: lockowner released or not found
7540+
* %nfserr_locks_held: lockowner still in use
7541+
* %nfserr_stale_clientid: clientid no longer active
7542+
* %nfserr_expired: clientid not recognized
7543+
*/
75277544
__be32
75287545
nfsd4_release_lockowner(struct svc_rqst *rqstp,
75297546
struct nfsd4_compound_state *cstate,
@@ -7550,7 +7567,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
75507567
lo = find_lockowner_str_locked(clp, &rlockowner->rl_owner);
75517568
if (!lo) {
75527569
spin_unlock(&clp->cl_lock);
7553-
return status;
7570+
return nfs_ok;
75547571
}
75557572
if (atomic_read(&lo->lo_owner.so_count) != 2) {
75567573
spin_unlock(&clp->cl_lock);
@@ -7566,11 +7583,11 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
75667583
put_ol_stateid_locked(stp, &reaplist);
75677584
}
75687585
spin_unlock(&clp->cl_lock);
7586+
75697587
free_ol_stateid_reaplist(&reaplist);
75707588
remove_blocked_locks(lo);
75717589
nfs4_put_stateowner(&lo->lo_owner);
7572-
7573-
return status;
7590+
return nfs_ok;
75747591
}
75757592

75767593
static inline struct nfs4_client_reclaim *

0 commit comments

Comments
 (0)