2017-11-18 14:56:17

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: Logically dead code at fs/afs/cell.c:206


Quoting David Howells <[email protected]>:

> Gustavo A. R. Silva <[email protected]> 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







From 1584416004629084199@xxx Sat Nov 18 14:54:10 +0000 2017
X-GM-THRID: 1584415759222250809
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread