Skip to contentSkip to conversation

fuse: fix an error code in fuse_lookup_name()

PATCH In review Dan Carpenter 3 participants 3 messages Aug 8, 2015 – Aug 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fuse: fix an error code in fuse_lookup_name()

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')
fs/fuse/dir.c +1 -2
index 5e2e087..225fc703 100644
@@ -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;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Dan Carpenter

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')
fs/fuse/dir.c +1 -3
index 5e2e087..225fc703 100644
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/fuse-devel

maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter
Quoted 4 lines

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

Quoted 26 lines
Quoted 25 lines
Fixes c180eebe1390 ('fuse: add fuse_lookup_name() helper')
fs/fuse/dir.c +1 -3
index 5e2e087..225fc703 100644
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/fuse-devel