btrfs: transaction_kthread() is not freezable
authorJiri Kosina <jkosina@suse.cz>
Tue, 15 Mar 2016 10:28:59 +0000 (11:28 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 22 Mar 2016 09:08:47 +0000 (10:08 +0100)
transaction_kthread() is calling try_to_freeze(), but that's just an
expeinsive no-op given the fact that the thread is not marked freezable.

After removing this, disk-io.c is now independent on freezer API.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c

index ff36a33ee9caaef54092ae5b5b9483584fdfdd75..81966676a26b76ebc4359c7d2f1c70e6d4721742 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/buffer_head.h>
 #include <linux/workqueue.h>
 #include <linux/kthread.h>
-#include <linux/freezer.h>
 #include <linux/slab.h>
 #include <linux/migrate.h>
 #include <linux/ratelimit.h>
@@ -1928,14 +1927,12 @@ sleep:
                if (unlikely(test_bit(BTRFS_FS_STATE_ERROR,
                                      &root->fs_info->fs_state)))
                        btrfs_cleanup_transaction(root);
-               if (!try_to_freeze()) {
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       if (!kthread_should_stop() &&
-                           (!btrfs_transaction_blocked(root->fs_info) ||
-                            cannot_commit))
-                               schedule_timeout(delay);
-                       __set_current_state(TASK_RUNNING);
-               }
+               set_current_state(TASK_INTERRUPTIBLE);
+               if (!kthread_should_stop() &&
+                               (!btrfs_transaction_blocked(root->fs_info) ||
+                                cannot_commit))
+                       schedule_timeout(delay);
+               __set_current_state(TASK_RUNNING);
        } while (!kthread_should_stop());
        return 0;
 }