[<prev] [next>] [day] [month] [year] [list]
Message-ID: <529ea928-88a6-2cbe-ba8c-72b4c68cc7e8@kernel.dk>
Date: Mon, 4 May 2020 07:47:54 -0600
From: Jens Axboe <axboe@...nel.dk>
To: David Binderman <dcb314@...mail.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: linux-5.7-rc4/fs/io_uring.c:2786: bad if test ?
On 5/4/20 2:12 AM, David Binderman wrote:
> Hello there,
>
> linux-5.7-rc4/fs/io_uring.c:2786:6: warning: Identical condition 'force_nonblock', second condition is always false [identicalConditionAfterEarlyExit]
>
> Source code is
>
> if (force_nonblock)
> return -EAGAIN;
>
> poff_in = (sp->off_in == -1) ? NULL : &sp->off_in;
> poff_out = (sp->off_out == -1) ? NULL : &sp->off_out;
> ret = do_splice(in, poff_in, out, poff_out, sp->len, flags);
> if (force_nonblock && ret == -EAGAIN)
> return -EAGAIN;
>
> So the second return can never execute. Suggest code rework.
Looks like that's a leftover of the "only punt sometimes" code. That
second one is indeed dead now, Pavel is re-working the async punt
for 5.8 anyway so I don't think it's worth touching at this point.
--
Jens Axboe
Powered by blists - more mailing lists