Whamcloud - gitweb
LU-10837 ldiskfs: skip bitmap check if block bitmap is uninitialized
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-mballoc-extra-checks.patch
index 63eb530..4b3104f 100644 (file)
@@ -121,7 +121,7 @@ Index: linux-stage/fs/ext4/mballoc.c
                                "[ %-5s %-5s %-5s %-5s %-5s %-5s %-5s "
                                  "%-5s %-5s %-5s %-5s %-5s %-5s %-5s ]\n",
 -                         "group", "free", "frags", "first",
-+                         "group", "free", "frags", "first", "first", "pa",
++                         "group", "free", "free", "frags", "first", "pa",
                           "2^0", "2^1", "2^2", "2^3", "2^4", "2^5", "2^6",
                           "2^7", "2^8", "2^9", "2^10", "2^11", "2^12", "2^13");
  
@@ -148,7 +148,7 @@ Index: linux-stage/fs/ext4/mballoc.c
        for (i = 0; i <= 13; i++)
                seq_printf(seq, " %-5u", i <= sb->s_blocksize_bits + 1 ?
                                sg.info.bb_counters[i] : 0);
-@@ -3354,23 +3365,68 @@
+@@ -3354,23 +3365,72 @@
  }
  
  /*
@@ -162,6 +162,10 @@ Index: linux-stage/fs/ext4/mballoc.c
 +{
 +      unsigned short max = EXT4_BLOCKS_PER_GROUP(sb);
 +      unsigned short i, first, free = 0;
++      unsigned short free_in_gdp = ext4_free_blks_count(sb, gdp);
++
++      if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))
++              return 0;
 +
 +      i = mb_find_next_zero_bit(bitmap, max, 0);
 +
@@ -175,10 +179,10 @@ Index: linux-stage/fs/ext4/mballoc.c
 +                      i = mb_find_next_zero_bit(bitmap, max, i);
 +      }
 +
-+      if (free != ext4_free_blks_count(sb, gdp)) {
++      if (free != free_in_gdp) {
 +              ext4_error(sb, "on-disk bitmap for group %d"
 +                      "corrupted: %u blocks free in bitmap, %u - in gd\n",
-+                      group, free, ext4_free_blks_count(sb, gdp));
++                      group, free, free_in_gdp);
 +              return -EIO;
 +      }
 +      return 0;