From: Mike Christie <mchristi@redhat.com>
To: lixiubo@cmss.chinamobile.com, nab@linux-iscsi.org
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again
Date: Thu, 15 Jun 2017 14:00:17 -0500 [thread overview]
Message-ID: <5942D941.6010709@redhat.com> (raw)
In-Reply-To: <1497510331-17918-1-git-send-email-lixiubo@cmss.chinamobile.com>
On 06/15/2017 02:05 AM, lixiubo@cmss.chinamobile.com wrote:
> From: Xiubo Li <lixiubo@cmss.chinamobile.com>
>
> Because the unmap code just after the schdule() returned may take
> a long time and if the kthread_stop() is fired just when in this
> routine, the module removal maybe stuck too.
>
> Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
> ---
> drivers/target/target_core_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index beb5f09..203bff1 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -1573,7 +1573,7 @@ static int unmap_thread_fn(void *data)
> struct page *page;
> int i;
>
> - while (1) {
> + while (!kthread_should_stop()) {
> DEFINE_WAIT(__wait);
>
> prepare_to_wait(&unmap_wait, &__wait, TASK_INTERRUPTIBLE);
>
Looks ok to me
Reviewed-by: Mike Christie <mchristi@redhat.com>
next prev parent reply other threads:[~2017-06-15 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 7:05 [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again lixiubo
2017-06-15 19:00 ` Mike Christie [this message]
2017-06-25 19:38 ` Nicholas A. Bellinger
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=5942D941.6010709@redhat.com \
--to=mchristi@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=lixiubo@cmss.chinamobile.com \
--cc=nab@linux-iscsi.org \
--cc=target-devel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).