kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v2] fuse: remove dead code in fuse_lookup_name()
@ 2015-08-12 21:06 Dan Carpenter
  2015-08-12 21:57 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-08-12 21:06 UTC (permalink / raw)
  To: kernel-janitors

We check "outarg->nodeid" twice in a row and it causes a static checker
warning.  We should return success if "outarg->nodeid" is zero so the
first check is correct and the second one should be deleted.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: The first version of this patch introduced a bug into working code.
    (returning error instead of success).  Sorry.  :(

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 5e2e087..56a3463 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -306,11 +306,10 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
 
 	fuse_lookup_init(fc, &args, nodeid, name, outarg);
 	err = fuse_simple_request(fc, &args);
-	/* Zero nodeid is same as -ENOENT, but with valid timeout */
-	if (err || !outarg->nodeid)
+	if (err)
 		goto out_put_forget;
 
-	err = -EIO;
+	/* Zero nodeid is same as -ENOENT, but with valid timeout */
 	if (!outarg->nodeid)
 		goto out_put_forget;
 	if (!fuse_valid_type(outarg->attr.mode))

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

* Re: [patch v2] fuse: remove dead code in fuse_lookup_name()
  2015-08-12 21:06 [patch v2] fuse: remove dead code in fuse_lookup_name() Dan Carpenter
@ 2015-08-12 21:57 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-08-12 21:57 UTC (permalink / raw)
  To: kernel-janitors

Oh...  Crap.  I suck.  Sorry, ignore this patch.  It's buggy as well.

I'm so really really sorry.

regards,
dan carpenter

On Thu, Aug 13, 2015 at 12:06:44AM +0300, Dan Carpenter wrote:
> We check "outarg->nodeid" twice in a row and it causes a static checker
> warning.  We should return success if "outarg->nodeid" is zero so the
> first check is correct and the second one should be deleted.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: The first version of this patch introduced a bug into working code.
>     (returning error instead of success).  Sorry.  :(
> 
> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
> index 5e2e087..56a3463 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -306,11 +306,10 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
>  
>  	fuse_lookup_init(fc, &args, nodeid, name, outarg);
>  	err = fuse_simple_request(fc, &args);
> -	/* Zero nodeid is same as -ENOENT, but with valid timeout */
> -	if (err || !outarg->nodeid)
> +	if (err)
>  		goto out_put_forget;
>  
> -	err = -EIO;
> +	/* Zero nodeid is same as -ENOENT, but with valid timeout */
>  	if (!outarg->nodeid)
>  		goto out_put_forget;
>  	if (!fuse_valid_type(outarg->attr.mode))

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

end of thread, other threads:[~2015-08-12 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12 21:06 [patch v2] fuse: remove dead code in fuse_lookup_name() Dan Carpenter
2015-08-12 21:57 ` Dan Carpenter

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).