From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch v2] fuse: remove dead code in fuse_lookup_name()
Date: Wed, 12 Aug 2015 21:06:44 +0000 [thread overview]
Message-ID: <20150812210644.GA8068@mwanda> (raw)
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))
next reply other threads:[~2015-08-12 21:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 21:06 Dan Carpenter [this message]
2015-08-12 21:57 ` [patch v2] fuse: remove dead code in fuse_lookup_name() Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150812210644.GA8068@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).