1 ext4: add missing unlock in ext4_check_descriptors() on error path
3 From: Li Zefan <lizf@cn.fujitsu.com>
5 If there group descriptors are corrupted we need unlock the block
6 group lock before returning from the function; else we will oops when
7 freeing a spinlock which is still being held.
9 Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 fs/ext4/super.c | 4 +++-
13 1 files changed, 3 insertions(+), 1 deletions(-)
15 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
16 index 566344b..24e7df6 100644
19 @@ -1623,8 +1623,10 @@ static int ext4_check_descriptors(struct super_block *sb)
20 "Checksum for group %lu failed (%u!=%u)\n",
21 i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
22 gdp)), le16_to_cpu(gdp->bg_checksum));
23 - if (!(sb->s_flags & MS_RDONLY))
24 + if (!(sb->s_flags & MS_RDONLY)) {
25 + spin_unlock(sb_bgl_lock(sbi, i));
29 spin_unlock(sb_bgl_lock(sbi, i));