Re: io_uring: process task work in io_uring_register()

From: Jann Horn
Date: Thu Oct 08 2020 - 15:15:18 EST


On Thu, Oct 8, 2020 at 9:13 PM Jann Horn <jannh@xxxxxxxxxx> wrote:
>
> On Thu, Oct 8, 2020 at 8:24 PM Colin Ian King <colin.king@xxxxxxxxxxxxx> wrote:
> > Static analysis with Coverity has detected a "dead-code" issue with the
> > following commit:
> >
> > commit af9c1a44f8dee7a958e07977f24ba40e3c770987
> > Author: Jens Axboe <axboe@xxxxxxxxx>
> > Date: Thu Sep 24 13:32:18 2020 -0600
> >
> > io_uring: process task work in io_uring_register()
> >
> > The analysis is as follows:
> >
> > 9513 do {
> > 9514 ret =
> > wait_for_completion_interruptible(&ctx->ref_comp);
> >
> > cond_const: Condition ret, taking false branch. Now the value of ret is
> > equal to 0.
>
> Does this mean Coverity is claiming that
> wait_for_completion_interruptible() can't return non-zero values? If
> so, can you figure out why Coverity thinks that? If that was true,
> it'd sound like a core kernel bug, rather than a uring issue...

Ah, nevermind, I missed the part where we only break out of the loop
if ret==0... sorry for the noise, ignore me.