From: Rusty Russell <rusty@rustcorp.com.au>
To: Oleg Nesterov <oleg@redhat.com>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>,
Robert Peterson <rpeterso@redhat.com>,
stable@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -stable] kthreads: fix kthread_create() vs kthread_stop() race
Date: Wed, 26 Aug 2009 00:06:06 +0930 [thread overview]
Message-ID: <200908260006.07310.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090824104529.GA6899@redhat.com>
On Mon, 24 Aug 2009 08:15:29 pm Oleg Nesterov wrote:
> The bug should be "accidently" fixed by recent changes in 2.6.31,
> all kernels <= 2.6.30 need the fix. The problem was never noticed before,
> it was found because it causes mysterious failures with GFS mount/umount.
>
> Credits to Robert Peterson. He blaimed kthread.c from the very beginning.
> But, despite my promise, I forgot to inspect the old implementation until
> he did a lot of testing and reminded me. This led to huge delay in fixing
> this bug.
>
> kthread_stop() does put_task_struct(k) before it clears kthread_stop_info.k.
> This means another kthread_create() can re-use this task_struct, but the
> new kthread can still see kthread_should_stop() == T and exit even without
> calling threadfn().
>
> Reported-by: Robert Peterson <rpeterso@redhat.com>
> Tested-by: Robert Peterson <rpeterso@redhat.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Thanks, good catch!
Rusty.
prev parent reply other threads:[~2009-08-25 14:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 10:45 [PATCH -stable] kthreads: fix kthread_create() vs kthread_stop() race Oleg Nesterov
2009-08-25 14:36 ` Rusty Russell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908260006.07310.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=rpeterso@redhat.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.