linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: tidy return values in nfs4_delegation_exists()
@ 2018-03-23 11:37 Dan Carpenter
  2018-03-23 18:50 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-03-23 11:37 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Jeff Layton, linux-nfs, kernel-janitors

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 <dan.carpenter@oracle.com>

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;
 }
 
 /**

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfsd: tidy return values in nfs4_delegation_exists()
  2018-03-23 11:37 [PATCH] nfsd: tidy return values in nfs4_delegation_exists() Dan Carpenter
@ 2018-03-23 18:50 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2018-03-23 18:50 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Jeff Layton, linux-nfs, kernel-janitors

On Fri, Mar 23, 2018 at 02:37:05PM +0300, Dan Carpenter wrote:
> 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.

Oops, I fixed this a couple days ago when Fengguang Wu complained about
the 0/false thing, but forgot to push it out.  Added a Reported-by: for
you and pushed it out now to

	git://linux-nfs.org/~bfields/linux.git nfsd-next

--b.

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> 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;
>  }
>  
>  /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-23 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 11:37 [PATCH] nfsd: tidy return values in nfs4_delegation_exists() Dan Carpenter
2018-03-23 18:50 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).