Skip to content

Commit

Permalink
ext4: add missing unlock in ext4_check_descriptors() on error path
Browse files Browse the repository at this point in the history
If there group descriptors are corrupted we need unlock the block
group lock before returning from the function; else we will oops when
freeing a spinlock which is still being held.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Li Zefan authored and Theodore Ts'o committed Sep 8, 2008
1 parent 0549676 commit 7ee1ec4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,8 +1623,10 @@ static int ext4_check_descriptors(struct super_block *sb)
"Checksum for group %lu failed (%u!=%u)\n",
i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
gdp)), le16_to_cpu(gdp->bg_checksum));
if (!(sb->s_flags & MS_RDONLY))
if (!(sb->s_flags & MS_RDONLY)) {
spin_unlock(sb_bgl_lock(sbi, i));
return 0;
}
}
spin_unlock(sb_bgl_lock(sbi, i));
if (!flexbg_flag)
Expand Down

0 comments on commit 7ee1ec4

Please sign in to comment.