public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "홍신 shin hong" <hongshin@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true
Date: Thu, 3 Sep 2009 19:12:47 +0900	[thread overview]
Message-ID: <2014bcab0909030312i73f6cccfib1e612da0501cfc6@mail.gmail.com> (raw)

upstream commit 2ad49887150894b9ed6a87a76b409adceee6b074

Motivated from the commit,
I found that cleaner_kthread() and transaction_kthread()
can result similar error since these two function can exit
even though kthread_should_stop() is not true.

In order to resolve the bug, break statements are changed
into continue statements in order to wait until kthread_should_stop()
becomes true.


--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c

--- a/fs/btrfs/disk-io.c   2009-08-17 06:19:38.000000000 +0900
+++ a/fs/btrfs/disk-io.c 2009-09-03 19:09:14.640625000 +0900
@@ -1435,7 +1435,7 @@
        do {
                smp_mb();
                if (root->fs_info->closing)
-                       break;
+                       continue;

                vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
                mutex_lock(&root->fs_info->cleaner_mutex);
@@ -1447,7 +1447,7 @@
                } else {
                        smp_mb();
                        if (root->fs_info->closing)
-                               break;
+                               continue;
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule();
                        __set_current_state(TASK_RUNNING);
@@ -1468,7 +1468,7 @@
        do {
                smp_mb();
                if (root->fs_info->closing)
-                       break;
+                       continue;

                delay = HZ * 30;
                vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
@@ -1499,7 +1499,7 @@
                        refrigerator();
                } else {
                        if (root->fs_info->closing)
-                               break;
+                               continue;
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule_timeout(delay);
                        __set_current_state(TASK_RUNNING);

             reply	other threads:[~2009-09-03 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 10:12 홍신 shin hong [this message]
2009-09-04  0:06 ` [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true 홍신 shin hong
2009-09-04  0:11   ` 홍신 shin hong

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=2014bcab0909030312i73f6cccfib1e612da0501cfc6@mail.gmail.com \
    --to=hongshin@gmail.com \
    --cc=linux-btrfs@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