diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 831ddd4bf897..2c6791493637 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -280,11 +280,23 @@ static int process_one_buffer(struct btrfs_root *log, | |||
280 | { | 280 | { |
281 | int ret = 0; | 281 | int ret = 0; |
282 | 282 | ||
283 | /* | ||
284 | * If this fs is mixed then we need to be able to process the leaves to | ||
285 | * pin down any logged extents, so we have to read the block. | ||
286 | */ | ||
287 | if (btrfs_fs_incompat(log->fs_info, MIXED_GROUPS)) { | ||
288 | ret = btrfs_read_buffer(eb, gen); | ||
289 | if (ret) | ||
290 | return ret; | ||
291 | } | ||
292 | |||
283 | if (wc->pin) | 293 | if (wc->pin) |
284 | ret = btrfs_pin_extent_for_log_replay(log->fs_info->extent_root, | 294 | ret = btrfs_pin_extent_for_log_replay(log->fs_info->extent_root, |
285 | eb->start, eb->len); | 295 | eb->start, eb->len); |
286 | 296 | ||
287 | if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { | 297 | if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { |
298 | if (wc->pin && btrfs_header_level(eb) == 0) | ||
299 | ret = btrfs_exclude_logged_extents(log, eb); | ||
288 | if (wc->write) | 300 | if (wc->write) |
289 | btrfs_write_tree_block(eb); | 301 | btrfs_write_tree_block(eb); |
290 | if (wc->wait) | 302 | if (wc->wait) |