Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp690486pxb; Tue, 5 Apr 2022 18:56:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuvzb/7ch/Ko/MC33I7Voclq+uMU1epljuSZ386CB6vKWusL1IcWYv6if+NdcWjzVGjZ7e X-Received: by 2002:aa7:c307:0:b0:41c:d381:d60e with SMTP id l7-20020aa7c307000000b0041cd381d60emr6423579edq.184.1649210194354; Tue, 05 Apr 2022 18:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210194; cv=none; d=google.com; s=arc-20160816; b=My1wbotTiEuIogGGP2QVIdBOi1hldh7wEt3e8GCHiG4Tk4aQzX2mOPM8v8t8RRnffu RMjWuuJsp+A5mg2EWWT78sffSzmDqTUyieKHGD2uhBIM18ZFb2zU9yFivXQ/rerB+lkp Kzj/IXTMqq+/BwYkxCVuhHlR6HJHPQuJmR2BgRJUhl0Kl6RjcsJBcJVeqxtoQBtvwYXF fztsuP1L9uXjYg0wT9oot48D9XmDUfDZQKNAUss76VxMf3kXwzZmS2wipG4OttVkO4jz CyZGS7R9N2QkgTv7l0fBtAF3ZuVZUwjAtDqZQoC3EmV8vnN9OgbLvAfcFcLM5Pd6wEuF o1HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gA87N+igPudCTEX94OIeQOeHMiZ19FAa/m8FWNtueMc=; b=n44gyxxBKBOhtzI0x4evF/sIa6ExBQfr73aihBIumm5gfMdcXjlIjtvfRQXWz3klUr YSEqpeTam8kDtlj6IkjQjC/2SqABOnJU3py4CSirLJQNOmbhvCr9l8er9xm9wQeIy1Hq umKaG0tLxdv9rTS1B2hs5xsdSFtH08D2kFPQNWPXWEu679nWZeTLAeif8bYotXHKIF/g t+SA327pMhqECZtXiFTKdUJ6g9JgvTS+4hxP57SdXduSAmT0TUxGagQT3FVq1htmvuBj Xw5yw1HtsRzdN8giVoaC8hUylH4RDi5zw8okztZgbeZvoMvXg04QCt+ARAwg18Vftf+9 o8Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r5BNr1Uq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a056402239200b0041ccf08b6bbsi6060550eda.595.2022.04.05.18.56.07; Tue, 05 Apr 2022 18:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r5BNr1Uq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382645AbiDENSB (ORCPT + 99 others); Tue, 5 Apr 2022 09:18:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344348AbiDEJTe (ORCPT ); Tue, 5 Apr 2022 05:19:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 731DBE0D9; Tue, 5 Apr 2022 02:07:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25062B81C19; Tue, 5 Apr 2022 09:07:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 674CFC385A0; Tue, 5 Apr 2022 09:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149657; bh=UPyd4KE5RZhuBQ3r29MQ6fG0fXlHOPnapWsvTCOT5Uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r5BNr1UqGl7ljJG4spYyWwQM7Xm4oiHGBUeZfguwGOPoB/nhY04pvFXk5cgJg/Eeq /lAW+Di3XjWEDPmYemCsWxD2JrYJzRIss1hWg9QVnbVuLJc2OUCCV9Zjw8C6dNd8Ni uHgQ6Uu1aWNVI2FqD6QTQ43iiJQFoeFnHRmG509A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dai Ngo , Chuck Lever , Sasha Levin Subject: [PATCH 5.16 0792/1017] NFSD: Fix nfsd_breaker_owns_lease() return values Date: Tue, 5 Apr 2022 09:28:25 +0200 Message-Id: <20220405070417.761952002@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuck Lever [ 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 Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/nfsd/nfs4state.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index ac0ddde8beef..6075a328d756 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -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; } -- 2.34.1