ocfs2: validate bg_free_bits_count after update
authorSrinivas Eeda <srinivas.eeda@oracle.com>
Tue, 5 Oct 2010 22:53:06 +0000 (15:53 -0700)
committerJoel Becker <joel.becker@oracle.com>
Mon, 11 Oct 2010 20:43:24 +0000 (13:43 -0700)
commit9b5cd10e4c14a1a642076ace6a73be3d33c91fb6
tree92f0f09460a9574d1dbe53b2c376cd4193d19d91
parent93f3b86fb1bd0ad7b4a5eb1ad1fdae2b290633b7
ocfs2: validate bg_free_bits_count after update

This patch adds a safe check to ensure bg_free_bits_count doesn't exceed
bg_bits in a group descriptor. This is to avoid on disk corruption that was
seen recently.

debugfs: group <52803072>
       Group Chain: 179   Parent Inode: 11  Generation: 2959379682
       CRC32: 00000000   ECC: 0000
       ##   Block#            Total    Used     Free     Contig   Size
       0    52803072          32256    4294965350   34202    18207    4032
       ......

Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/suballoc.c