diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-10-14 09:24:59 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-10-14 10:32:48 -0400 |
commit | 86df7eb921a009515285e7171363fa57dd2d7d31 (patch) | |
tree | 884e8cda2535dc43cf57ce9fa273381b827d2f4f /fs | |
parent | 5d5e103a70f74ae98e3965a4add1ab951d0651d1 (diff) | |
download | kernel_samsung_espresso10-86df7eb921a009515285e7171363fa57dd2d7d31.zip kernel_samsung_espresso10-86df7eb921a009515285e7171363fa57dd2d7d31.tar.gz kernel_samsung_espresso10-86df7eb921a009515285e7171363fa57dd2d7d31.tar.bz2 |
Btrfs: properly wait log writers during log sync
A recently fsync optimization make btrfs_sync_log skip calling
wait_for_writer in the single log writer case. This is incorrect
since the writer count can also be increased by btrfs_pin_log.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/tree-log.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 4aff766..f51bf13 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, if (atomic_read(&root->log_commit[(index1 + 1) % 2])) wait_log_commit(trans, root, root->log_transid - 1); - while (root->log_multiple_pids) { + while (1) { unsigned long batch = root->log_batch; - mutex_unlock(&root->log_mutex); - schedule_timeout_uninterruptible(1); - mutex_lock(&root->log_mutex); - + if (root->log_multiple_pids) { + mutex_unlock(&root->log_mutex); + schedule_timeout_uninterruptible(1); + mutex_lock(&root->log_mutex); + } wait_for_writer(trans, root); if (batch == root->log_batch) break; |