]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
NFSD: Fix nfsd_breaker_owns_lease() return values
authorChuck Lever <chuck.lever@oracle.com>
Mon, 14 Feb 2022 20:30:13 +0000 (15:30 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:47 +0000 (14:39 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 50719bf3442dd6cd05159e9c98d020b3919ce978 ]

These have been incorrect since the function was introduced.

A proper kerneldoc comment is added since this function, though
static, is part of an external interface.

Reported-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7260793c13e9ae730867f0f6515d1af84f24308a)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/nfsd/nfs4state.c

index db4a47a280dc509cf8373fe34764f2c59704dcc0..181bc3d9f5663780ddcfdc85e2422a8d6156b982 100644 (file)
@@ -4693,6 +4693,14 @@ nfsd_break_deleg_cb(struct file_lock *fl)
        return ret;
 }
 
+/**
+ * nfsd_breaker_owns_lease - Check if lease conflict was resolved
+ * @fl: Lock state to check
+ *
+ * Return values:
+ *   %true: Lease conflict was resolved
+ *   %false: Lease conflict was not resolved.
+ */
 static bool nfsd_breaker_owns_lease(struct file_lock *fl)
 {
        struct nfs4_delegation *dl = fl->fl_owner;
@@ -4700,11 +4708,11 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)
        struct nfs4_client *clp;
 
        if (!i_am_nfsd())
-               return NULL;
+               return false;
        rqst = kthread_data(current);
        /* Note rq_prog == NFS_ACL_PROGRAM is also possible: */
        if (rqst->rq_prog != NFS_PROGRAM || rqst->rq_vers < 4)
-               return NULL;
+               return false;
        clp = *(rqst->rq_lease_breaker);
        return dl->dl_stid.sc_client == clp;
 }