From: Robbie Ko <>

when tree log recovery, space_cache rebuild or dirty maybe save the cache.
and then replay extent with disk_bytenr and disk_num_bytes,
but disk_bytenr and disk_num_bytes maybe had been use for free space inode,
will lead to -EINVEL.

BTRFS: error in btrfs_replay_log:2446: errno=-22 unknown (Failed to recover log 

therefore, we not save cache when tree log recovering.

Signed-off-by: Robbie Ko <>
 fs/btrfs/extent-tree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 665da8f..38b932c 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3434,6 +3434,7 @@ again:
        if (block_group->cached != BTRFS_CACHE_FINISHED ||
+               block_group->fs_info->log_root_recovering ||
            !btrfs_test_opt(root->fs_info, SPACE_CACHE)) {
                 * don't bother trying to write stuff out _if_

To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to
More majordomo info at

Reply via email to