]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: fix BUG when calculate new backup super
authorJoseph Qi <joseph.qi@huawei.com>
Tue, 29 Dec 2015 22:54:06 +0000 (14:54 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 26 Nov 2016 23:43:22 +0000 (15:43 -0800)
commit4c80d2127bfdded789db2aee5fead2f9a917d373
tree439e38f28c38aa215378424c1dfdd5ae8d2e44b2
parent75d9d0e42b811311c2a7bec02d58a63f46170b75
ocfs2: fix BUG when calculate new backup super

When resizing, it firstly extends the last gd.  Once it should backup
super in the gd, it calculates new backup super and update the
corresponding value.

But it currently doesn't consider the situation that the backup super is
already done.  And in this case, it still sets the bit in gd bitmap and
then decrease from bg_free_bits_count, which leads to a corrupted gd and
trigger the BUG in ocfs2_block_group_set_bits:

    BUG_ON(le16_to_cpu(bg->bg_free_bits_count) < num_bits);

So check whether the backup super is done and then do the updates.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 5c9ee4cbf2a945271f25b89b137f2c03bbc3be33)

Orabug: 24939243

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/resize.c