Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297888
b: refs/heads/master
c: 914b200
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and David Sterba committed Mar 22, 2012
1 parent fa6a72d commit b02c2e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79787eaab46121d4713ed03c8fc63b9ec3eaec76
refs/heads/master: 914b20070b413ca10f832c45a58b2894990f065f
9 changes: 7 additions & 2 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,10 @@ static int transaction_kthread(void *arg)
u64 transid;
unsigned long now;
unsigned long delay;
bool cannot_commit;

do {
cannot_commit = false;
delay = HZ * 30;
vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
mutex_lock(&root->fs_info->transaction_kthread_mutex);
Expand All @@ -1665,8 +1667,10 @@ static int transaction_kthread(void *arg)

/* If the file system is aborted, this will always fail. */
trans = btrfs_join_transaction(root);
if (IS_ERR(trans))
if (IS_ERR(trans)) {
cannot_commit = true;
goto sleep;
}
if (transid == trans->transid) {
btrfs_commit_transaction(trans, root);
} else {
Expand All @@ -1679,7 +1683,8 @@ static int transaction_kthread(void *arg)
if (!try_to_freeze()) {
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop() &&
!btrfs_transaction_blocked(root->fs_info))
(!btrfs_transaction_blocked(root->fs_info) ||
cannot_commit))
schedule_timeout(delay);
__set_current_state(TASK_RUNNING);
}
Expand Down

0 comments on commit b02c2e9

Please sign in to comment.