Skip to content

Commit e75ed71

Browse files
Changwei Getorvalds
authored andcommitted
ocfs2: unlock bh_state if bg check fails
We should unlock bh_stat if bg->bg_free_bits_count > bg->bg_bits Link: http://lkml.kernel.org/r/1516843095-23680-1-git-send-email-ge.changwei@h3c.com Signed-off-by: Changwei Ge <ge.changwei@h3c.com> Suggested-by: Jan Kara <jack@suse.cz> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Mark Fasheh <mfasheh@versity.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <jiangqi903@gmail.com> Cc: Changwei Ge <ge.changwei@h3c.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c4c2416 commit e75ed71

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/ocfs2/suballoc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,6 +2438,8 @@ static int ocfs2_block_group_clear_bits(handle_t *handle,
24382438
}
24392439
le16_add_cpu(&bg->bg_free_bits_count, num_bits);
24402440
if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
2441+
if (undo_fn)
2442+
jbd_unlock_bh_state(group_bh);
24412443
return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
24422444
(unsigned long long)le64_to_cpu(bg->bg_blkno),
24432445
le16_to_cpu(bg->bg_bits),

0 commit comments

Comments
 (0)