fuse: fix an error code in fuse_lookup_name()
Subsystems (2)
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.
fs/fuse/dir.c +1 -2
@@ -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 ;
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')Signed-off-by Dan Carpenter <[email protected]>fs/fuse/dir.c +1
-3@@ -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
Miklos Szeredi
maintainerQuoted 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')Signed-off-by Dan Carpenter <[email protected]>fs/fuse/dir.c +1
-3@@ -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