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/[email protected] Signed-off-by: Changwei Ge <[email protected]> Suggested-by: Jan Kara <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Joseph Qi <[email protected]> Cc: Changwei Ge <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent c4c2416 commit e75ed71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)