[PATCH] afs: Fix checking wait_event_interruptible() return value

David Howells dhowells at redhat.com
Fri Sep 13 08:48:39 PDT 2024


Alexandra Diupina <adiupina at astralinux.ru> 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





More information about the linux-afs mailing list