aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/disk-io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 74cbc342b29a..4ac8b1d21baf 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -436,6 +436,14 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
436 if (!first_key) 436 if (!first_key)
437 return 0; 437 return 0;
438 438
439 /*
440 * For live tree block (new tree blocks in current transaction),
441 * we need proper lock context to avoid race, which is impossible here.
442 * So we only checks tree blocks which is read from disk, whose
443 * generation <= fs_info->last_trans_committed.
444 */
445 if (btrfs_header_generation(eb) > fs_info->last_trans_committed)
446 return 0;
439 if (found_level) 447 if (found_level)
440 btrfs_node_key_to_cpu(eb, &found_key, 0); 448 btrfs_node_key_to_cpu(eb, &found_key, 0);
441 else 449 else