From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 389B913E3FF; Tue, 18 Jun 2024 13:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718716109; cv=none; b=CPsgrpaDk6ZibecYi6ZUowkyza/LIFOigb8XDVk45ZJRR7Fhul2K8oa1eRPbDlL14+/lXCdTEFD3NvkNsWIN0dpOx3cIjbwJn8So8xYqPpWKoZS/YHN4AkOkaBizKTJDXvBbxB4e67Oo5Sr11hMVfGfL1DWk3W3883Q5lXYuQ9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718716109; c=relaxed/simple; bh=V4M+Vw3w/Sl9xEZjJDeDm/C/nq2BCHbYkp6K6tM4LfI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EeFgKoDoqa3uK/vWVIUDbZhwmFZs7zsv6NmwGpZAwM6loLiiKbx/nPnhtkc9f+ubc7wgl/R7Zq3dzxnQzDvWARXP+I8+l019wTIA2NON/Na4a2roeS7U4baaZNOP2ZzAEbUzMWlByg12SsG2jSCZxj6YXiH5rI7x/JQlPgOtu8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Mz85Ga18; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Mz85Ga18" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFA5BC3277B; Tue, 18 Jun 2024 13:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718716109; bh=V4M+Vw3w/Sl9xEZjJDeDm/C/nq2BCHbYkp6K6tM4LfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mz85Ga188x6rG/3OYll7snrtzRTMBLyeMvYQbWvCNWYSwpMB1KGEhCjH0Weq5lmGf GWzDgJy1/esiaPgO63nyqhoxm9fTm5ZXcNTmNT0rXgKhFxjVeugx8mqzJEptozN9Ig Mze6PWCU0qnTJT4L78lxoA+tBM9B5+/ogW1kgh6I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chuck Lever , Sasha Levin Subject: [PATCH 5.10 535/770] NFSD: Add documenting comment for nfsd4_release_lockowner() Date: Tue, 18 Jun 2024 14:36:28 +0200 Message-ID: <20240618123427.960961497@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618123407.280171066@linuxfoundation.org> References: <20240618123407.280171066@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chuck Lever [ Upstream commit 043862b09cc00273e35e6c3a6389957953a34207 ] And return explicit nfserr values that match what is documented in the new comment / API contract. Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/nfsd/nfs4state.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 1c32765e86b1f..76ec207f5e44d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -7556,6 +7556,23 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner) return status; } +/** + * nfsd4_release_lockowner - process NFSv4.0 RELEASE_LOCKOWNER operations + * @rqstp: RPC transaction + * @cstate: NFSv4 COMPOUND state + * @u: RELEASE_LOCKOWNER arguments + * + * The lockowner's so_count is bumped when a lock record is added + * or when copying a conflicting lock. The latter case is brief, + * but can lead to fleeting false positives when looking for + * locks-in-use. + * + * Return values: + * %nfs_ok: lockowner released or not found + * %nfserr_locks_held: lockowner still in use + * %nfserr_stale_clientid: clientid no longer active + * %nfserr_expired: clientid not recognized + */ __be32 nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, @@ -7582,7 +7599,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, lo = find_lockowner_str_locked(clp, &rlockowner->rl_owner); if (!lo) { spin_unlock(&clp->cl_lock); - return status; + return nfs_ok; } if (atomic_read(&lo->lo_owner.so_count) != 2) { spin_unlock(&clp->cl_lock); @@ -7598,11 +7615,11 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, put_ol_stateid_locked(stp, &reaplist); } spin_unlock(&clp->cl_lock); + free_ol_stateid_reaplist(&reaplist); remove_blocked_locks(lo); nfs4_put_stateowner(&lo->lo_owner); - - return status; + return nfs_ok; } static inline struct nfs4_client_reclaim * -- 2.43.0