aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/tree-log.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 4aff766d171a..f51bf13125c0 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1995,12 +1995,13 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
1995 if (atomic_read(&root->log_commit[(index1 + 1) % 2])) 1995 if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
1996 wait_log_commit(trans, root, root->log_transid - 1); 1996 wait_log_commit(trans, root, root->log_transid - 1);
1997 1997
1998 while (root->log_multiple_pids) { 1998 while (1) {
1999 unsigned long batch = root->log_batch; 1999 unsigned long batch = root->log_batch;
2000 mutex_unlock(&root->log_mutex); 2000 if (root->log_multiple_pids) {
2001 schedule_timeout_uninterruptible(1); 2001 mutex_unlock(&root->log_mutex);
2002 mutex_lock(&root->log_mutex); 2002 schedule_timeout_uninterruptible(1);
2003 2003 mutex_lock(&root->log_mutex);
2004 }
2004 wait_for_writer(trans, root); 2005 wait_for_writer(trans, root);
2005 if (batch == root->log_batch) 2006 if (batch == root->log_batch)
2006 break; 2007 break;