From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: Logically dead code at fs/afs/cell.c:206
Date: Fri, 17 Nov 2017 16:26:16 -0600 [thread overview]
Message-ID: <20171117162616.Horde.VzOsCimCLXyyQJfEt3LNf9n@gator4166.hostgator.com> (raw)
In-Reply-To: <4923.1510957307@warthog.procyon.org.uk>
Quoting David Howells <dhowells@redhat.com>:
> Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
>
>> Today Coverity reported a "Logically dead code" issue at fs/afs/cell.c:206:
>>
>> if (!excl) {
>> rcu_read_lock();
>> cell = afs_lookup_cell_rcu(net, name, namesz);
>> rcu_read_unlock();
>> if (!IS_ERR(cell)) {
>> if (excl) {
>> afs_put_cell(net, cell);
>> return ERR_PTR(-EEXIST);
>> }
>> goto wait_for_cell;
>> }
>> }
>>
>> The problem is that when this code block is executed, the code block
>> starting at line 211 makes no sense, as _excl_ can never be true.
>
> Good catch. The interior "if (excl) { ... }" statement and body needs
> removing entirely. Originally the outer "if (!excl)" wrapping it wasn't
> there.
>
I'll send a patch to remove that code.
Thanks for clarifying.
--
Gustavo A. R. Silva
prev parent reply other threads:[~2017-11-17 22:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 21:57 Logically dead code at fs/afs/cell.c:206 Gustavo A. R. Silva
2017-11-17 22:21 ` David Howells
2017-11-17 22:26 ` Gustavo A. R. Silva [this message]
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=20171117162616.Horde.VzOsCimCLXyyQJfEt3LNf9n@gator4166.hostgator.com \
--to=garsilva@embeddedor.com \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@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).