kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fuse: fix an error code in fuse_lookup_name()
@ 2015-08-08 13:01 Dan Carpenter
  2015-08-10 18:45 ` [fuse-devel] " Ashish Samant
  2015-08-12  9:22 ` Miklos Szeredi
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-08-08 13:01 UTC (permalink / raw)
  To: kernel-janitors

This is a static checker fix because we check "outarg->nodeid" here and
then again a in the next if statement.  The difference is that for this
first one we don't set the error code.

Fixes: c180eebe1390 ('fuse: add fuse_lookup_name() helper')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 5e2e087..225fc703 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -306,8 +306,7 @@ 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;

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

* Re: [fuse-devel] [patch] fuse: fix an error code in fuse_lookup_name()
  2015-08-08 13:01 [patch] fuse: fix an error code in fuse_lookup_name() Dan Carpenter
@ 2015-08-10 18:45 ` Ashish Samant
  2015-08-12  9:22 ` Miklos Szeredi
  1 sibling, 0 replies; 3+ messages in thread
From: Ashish Samant @ 2015-08-10 18:45 UTC (permalink / raw)
  To: kernel-janitors

Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
On 08/08/2015 06:01 AM, Dan Carpenter wrote:
> This is a static checker fix because we check "outarg->nodeid" here and
> then again a in the next if statement.  The difference is that for this
> first one we don't set the error code.
>
> Fixes: c180eebe1390 ('fuse: add fuse_lookup_name() helper')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
> index 5e2e087..225fc703 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -306,8 +306,7 @@ 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;
>
> ------------------------------------------------------------------------------
> _______________________________________________
> fuse-devel mailing list
> fuse-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>


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

* Re: [fuse-devel] [patch] fuse: fix an error code in fuse_lookup_name()
  2015-08-08 13:01 [patch] fuse: fix an error code in fuse_lookup_name() Dan Carpenter
  2015-08-10 18:45 ` [fuse-devel] " Ashish Samant
@ 2015-08-12  9:22 ` Miklos Szeredi
  1 sibling, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2015-08-12  9:22 UTC (permalink / raw)
  To: kernel-janitors

> On 08/08/2015 06:01 AM, Dan Carpenter wrote:
>>
>> This is a static checker fix because we check "outarg->nodeid" here and
>> then again a in the next if statement.  The difference is that for this
>> first one we don't set the error code.

Except for the fact that zero error code is correct (as the comment
indicates) and EIO would be wrong.  So the patch actually breaks the
code, not fixes it.

Thanks,
Miklos

>>
>> Fixes: c180eebe1390 ('fuse: add fuse_lookup_name() helper')
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
>> index 5e2e087..225fc703 100644
>> --- a/fs/fuse/dir.c
>> +++ b/fs/fuse/dir.c
>> @@ -306,8 +306,7 @@ 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;
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> fuse-devel mailing list
>> fuse-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>>
>

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-08 13:01 [patch] fuse: fix an error code in fuse_lookup_name() Dan Carpenter
2015-08-10 18:45 ` [fuse-devel] " Ashish Samant
2015-08-12  9:22 ` Miklos Szeredi

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