From: Dan Carpenter <dan.carpenter@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch v3] fuse: clean up fuse_lookup_name()
Date: Tue, 25 Oct 2016 21:37:37 +0000 [thread overview]
Message-ID: <20161025213737.GB30419@elgon.mountain> (raw)
We check for !outarg->nodeid twice. The first time we return success
and the next time (which is dead code) we return -EIO. The correct
return is the current success return and we should delete the dead code.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I sent this patch last year, but the first time I changed the function
to return -EIO, then in the second patch I messed up so that if
fuse_valid_type() was false then we still returned success. But
hopefully version 3 is correct.
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index b3ebe512d64c..6277af3e9c45 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -321,13 +321,14 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const 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;
+
+ err = -EIO;
if (!fuse_valid_type(outarg->attr.mode))
goto out_put_forget;
reply other threads:[~2016-10-25 21:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20161025213737.GB30419@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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