Re: [PATCH] afs: Fix checking wait_event_interruptible() return value
From: David Howells
Date: Fri Sep 13 2024 - 11:49:07 EST
Alexandra Diupina <adiupina@xxxxxxxxxxxxx> wrote:
> The if-block in question is presumably supposed to handle
> wait_event_interruptible() failure, i.e. when it returns -ERESTARTSYS
> due to signal received by the task instead of a zero value.
>
> Fix the condition appropriately.
> ...
> - if (ret > 0) {
> + if (ret < 0) {
This isn't correct. If we take a signal, we need to drop out immediately
rather than going round again. However, you're right and "ret > 0" won't ever
happen. I need to have a ponder on this.
David