Re: [PATCH 1/5] seccomp: don't use semaphore and wait_queue together

From: Andrei Vagin
Date: Fri Jan 13 2023 - 16:51:32 EST


On Thu, Jan 12, 2023 at 6:58 AM Tycho Andersen <tycho@tycho.pizza> wrote:
>
> On Tue, Jan 10, 2023 at 01:30:06PM -0800, Andrei Vagin wrote:
> > From: Andrei Vagin <avagin@xxxxxxxxx>
> >
> > The main reason is to use new wake_up helpers that will be added in the
> > following patches. But here are a few other reasons:
> >
> > * if we use two different ways, we always need to call them both. This
> > patch fixes seccomp_notify_recv where we forgot to call wake_up_poll
> > in the error path.
>
> [snip]
>
> > @@ -1515,7 +1546,8 @@ static long seccomp_notify_recv(struct seccomp_filter *filter,
> > if (should_sleep_killable(filter, knotif))
> > complete(&knotif->ready);
> > knotif->state = SECCOMP_NOTIFY_INIT;
> > - up(&filter->notif->request);
> > + atomic_add(1, &filter->notif->requests);
> > + wake_up_poll(&filter->wqh, EPOLLIN | EPOLLRDNORM);
> > }
> > mutex_unlock(&filter->notify_lock);
> > }
>
> I wonder if this shouldn't be a separate patch that you can send now
> independent of this series?

You are right. It is a bug fix and I can send it in a separate patch.
I didn't expect it would take so long to merge the whole set.

Thanks,
Andrei