Skip to content

Commit ce63f89

Browse files
Jiri Kosinakdave
authored andcommitted
btrfs: transaction_kthread() is not freezable
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>
1 parent 838fe18 commit ce63f89

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

fs/btrfs/disk-io.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/buffer_head.h>
2626
#include <linux/workqueue.h>
2727
#include <linux/kthread.h>
28-
#include <linux/freezer.h>
2928
#include <linux/slab.h>
3029
#include <linux/migrate.h>
3130
#include <linux/ratelimit.h>
@@ -1928,14 +1927,12 @@ static int transaction_kthread(void *arg)
19281927
if (unlikely(test_bit(BTRFS_FS_STATE_ERROR,
19291928
&root->fs_info->fs_state)))
19301929
btrfs_cleanup_transaction(root);
1931-
if (!try_to_freeze()) {
1932-
set_current_state(TASK_INTERRUPTIBLE);
1933-
if (!kthread_should_stop() &&
1934-
(!btrfs_transaction_blocked(root->fs_info) ||
1935-
cannot_commit))
1936-
schedule_timeout(delay);
1937-
__set_current_state(TASK_RUNNING);
1938-
}
1930+
set_current_state(TASK_INTERRUPTIBLE);
1931+
if (!kthread_should_stop() &&
1932+
(!btrfs_transaction_blocked(root->fs_info) ||
1933+
cannot_commit))
1934+
schedule_timeout(delay);
1935+
__set_current_state(TASK_RUNNING);
19391936
} while (!kthread_should_stop());
19401937
return 0;
19411938
}

0 commit comments

Comments
 (0)