From patchwork Fri Mar 23 11:37:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10304181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E70A660386 for ; Fri, 23 Mar 2018 11:37:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7BF928DEC for ; Fri, 23 Mar 2018 11:37:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBB3428DEE; Fri, 23 Mar 2018 11:37:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D75828DEC for ; Fri, 23 Mar 2018 11:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbeCWLhT (ORCPT ); Fri, 23 Mar 2018 07:37:19 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:34882 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbeCWLhR (ORCPT ); Fri, 23 Mar 2018 07:37:17 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2NBO2Us082452; Fri, 23 Mar 2018 11:37:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=YwRYFLlsRMhULEt7fl/2Psv11m4B47j2NtFzDdAtRdQ=; b=fTKYZrpiHYv1quehW7/hjTr0iM17sAAG37vtre2NGYq+2p/kseN4w5976jz6H7UtHFRE imacjQ3Cnxjqu1PjTMKtN1n3ch12I96VBTe8CQ51ppGpnAY6WYC6ao5s2K0/6zkvqT5O rKHolvYMrF6q9cI9sUlzvXH6tuCIPoKe09P+O+VwL2CadAReuHXGjfI8YL6uQz4865Ev eJqr8/O5R46Oc6CewCfiwNu03C6WYZI/CwhQ052uElnbX5tZt7tj1NORF9KLUc2m3+uK Vv1IzjAnJZnMUfGDW/2+tFxuPFXKNBTpHXjzqvH68IJf9yAgGNz2ChPYUFjXDmjf6GX2 yw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gw0nvg3dm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Mar 2018 11:37:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2NBbCb9006905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Mar 2018 11:37:13 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2NBbCSX014802; Fri, 23 Mar 2018 11:37:12 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Mar 2018 04:37:11 -0700 Date: Fri, 23 Mar 2018 14:37:05 +0300 From: Dan Carpenter To: "J. Bruce Fields" Cc: Jeff Layton , linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] nfsd: tidy return values in nfs4_delegation_exists() Message-ID: <20180323113705.GB28518@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8840 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=942 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803200127 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We made nfs4_delegation_exists() return a bool in 68b18f52947b ("nfsd: make nfs4_get_existing_delegation less confusing"), but it's still returning -EINVAL. That's fine, because it -EINVAL becomes true which is what we want, but it's not very tidy. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a64ee08aadb2..f0b5af3ca8f7 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -935,10 +935,10 @@ nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp) list_for_each_entry(searchdp, &fp->fi_delegations, dl_perfile) { searchclp = searchdp->dl_stid.sc_client; if (clp == searchclp) { - return -EAGAIN; + return true; } } - return 0; + return false; } /**