Btrfs: check_int, remove warning for mixed-mode
authorStefan Behrens <sbehrens@giantdisaster.de>
Mon, 21 Oct 2013 16:46:58 +0000 (18:46 +0200)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:04:25 +0000 (22:04 -0500)
In mixed-mode, when a data-block was later reused for metadata, a
warning was printed. This condition is now filtered out and the
warning is eliminated in this case.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/check-integrity.c

index 3281f7ebc0f7a47c0a2968f21ce50493243bf331..656b07637e3931dc629d464b5d7927b4235e878e 100644 (file)
@@ -1900,7 +1900,9 @@ again:
                                                               dev_state,
                                                               dev_bytenr);
                        }
-                       if (block->logical_bytenr != bytenr) {
+                       if (block->logical_bytenr != bytenr &&
+                           !(!block->is_metadata &&
+                             block->logical_bytenr == 0))
                                printk(KERN_INFO
                                       "Written block @%llu (%s/%llu/%d)"
                                       " found in hash table, %c,"
@@ -1910,15 +1912,14 @@ again:
                                       block->mirror_num,
                                       btrfsic_get_block_type(state, block),
                                       block->logical_bytenr);
-                               block->logical_bytenr = bytenr;
-                       } else if (state->print_mask &
-                                  BTRFSIC_PRINT_MASK_VERBOSE)
+                       else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
                                printk(KERN_INFO
                                       "Written block @%llu (%s/%llu/%d)"
                                       " found in hash table, %c.\n",
                                       bytenr, dev_state->name, dev_bytenr,
                                       block->mirror_num,
                                       btrfsic_get_block_type(state, block));
+                       block->logical_bytenr = bytenr;
                } else {
                        if (num_pages * PAGE_CACHE_SIZE <
                            state->datablock_size) {