public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true
@ 2009-09-03 10:12 홍신 shin hong
  2009-09-04  0:06 ` 홍신 shin hong
  0 siblings, 1 reply; 3+ messages in thread
From: 홍신 shin hong @ 2009-09-03 10:12 UTC (permalink / raw)
  To: linux-btrfs

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true
  2009-09-03 10:12 [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true 홍신 shin hong
@ 2009-09-04  0:06 ` 홍신 shin hong
  2009-09-04  0:11   ` 홍신 shin hong
  0 siblings, 1 reply; 3+ messages in thread
From: 홍신 shin hong @ 2009-09-04  0:06 UTC (permalink / raw)
  To: linux-btrfs

However, Vitaily Gusev notice me that kthread_stop() has been changed
recently so that it may executed for threads which was existed.
(commit  63706172f332fd3f6e7458ebfb35fa6de9c21dc5
              kthreads: rework kthread_stop())

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true
  2009-09-04  0:06 ` 홍신 shin hong
@ 2009-09-04  0:11   ` 홍신 shin hong
  0 siblings, 0 replies; 3+ messages in thread
From: 홍신 shin hong @ 2009-09-04  0:11 UTC (permalink / raw)
  To: linux-btrfs

However, it seems that the kthread_stop() patch is not yet applied.
Linux 2.6.30.5 still use the order one.

On Fri, Sep 4, 2009 at 9:06 AM, =ED=99=8D=EC=8B=A0 shin hong<hongshin@g=
mail.com> wrote:
> However, Vitaily Gusev notice me that kthread_stop() has been changed
> recently so that it may executed for threads which was existed.
> (commit =C2=A063706172f332fd3f6e7458ebfb35fa6de9c21dc5
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kthreads: rework kthr=
ead_stop())
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-04  0:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03 10:12 [PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true 홍신 shin hong
2009-09-04  0:06 ` 홍신 shin hong
2009-09-04  0:11   ` 홍신 shin hong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox