diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 0a1bde268963..4aff766d171a 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2013,7 +2013,10 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2013 | goto out; | 2013 | goto out; |
2014 | } | 2014 | } |
2015 | 2015 | ||
2016 | ret = btrfs_write_and_wait_marked_extents(log, &log->dirty_log_pages); | 2016 | /* we start IO on all the marked extents here, but we don't actually |
2017 | * wait for them until later. | ||
2018 | */ | ||
2019 | ret = btrfs_write_marked_extents(log, &log->dirty_log_pages); | ||
2017 | BUG_ON(ret); | 2020 | BUG_ON(ret); |
2018 | 2021 | ||
2019 | btrfs_set_root_node(&log->root_item, log->node); | 2022 | btrfs_set_root_node(&log->root_item, log->node); |
@@ -2048,6 +2051,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2048 | 2051 | ||
2049 | index2 = log_root_tree->log_transid % 2; | 2052 | index2 = log_root_tree->log_transid % 2; |
2050 | if (atomic_read(&log_root_tree->log_commit[index2])) { | 2053 | if (atomic_read(&log_root_tree->log_commit[index2])) { |
2054 | btrfs_wait_marked_extents(log, &log->dirty_log_pages); | ||
2051 | wait_log_commit(trans, log_root_tree, | 2055 | wait_log_commit(trans, log_root_tree, |
2052 | log_root_tree->log_transid); | 2056 | log_root_tree->log_transid); |
2053 | mutex_unlock(&log_root_tree->log_mutex); | 2057 | mutex_unlock(&log_root_tree->log_mutex); |
@@ -2067,6 +2071,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2067 | * check the full commit flag again | 2071 | * check the full commit flag again |
2068 | */ | 2072 | */ |
2069 | if (root->fs_info->last_trans_log_full_commit == trans->transid) { | 2073 | if (root->fs_info->last_trans_log_full_commit == trans->transid) { |
2074 | btrfs_wait_marked_extents(log, &log->dirty_log_pages); | ||
2070 | mutex_unlock(&log_root_tree->log_mutex); | 2075 | mutex_unlock(&log_root_tree->log_mutex); |
2071 | ret = -EAGAIN; | 2076 | ret = -EAGAIN; |
2072 | goto out_wake_log_root; | 2077 | goto out_wake_log_root; |
@@ -2075,6 +2080,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2075 | ret = btrfs_write_and_wait_marked_extents(log_root_tree, | 2080 | ret = btrfs_write_and_wait_marked_extents(log_root_tree, |
2076 | &log_root_tree->dirty_log_pages); | 2081 | &log_root_tree->dirty_log_pages); |
2077 | BUG_ON(ret); | 2082 | BUG_ON(ret); |
2083 | btrfs_wait_marked_extents(log, &log->dirty_log_pages); | ||
2078 | 2084 | ||
2079 | btrfs_set_super_log_root(&root->fs_info->super_for_commit, | 2085 | btrfs_set_super_log_root(&root->fs_info->super_for_commit, |
2080 | log_root_tree->node->start); | 2086 | log_root_tree->node->start); |