ext4: add missing unlock in ext4_check_descriptors() on error path
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>
This commit is contained in:
parent
05496769e5
commit
7ee1ec4ca3
@ -1623,9 +1623,11 @@ static int ext4_check_descriptors(struct super_block *sb)
|
|||||||
"Checksum for group %lu failed (%u!=%u)\n",
|
"Checksum for group %lu failed (%u!=%u)\n",
|
||||||
i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
|
i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
|
||||||
gdp)), le16_to_cpu(gdp->bg_checksum));
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
spin_unlock(sb_bgl_lock(sbi, i));
|
spin_unlock(sb_bgl_lock(sbi, i));
|
||||||
if (!flexbg_flag)
|
if (!flexbg_flag)
|
||||||
first_block += EXT4_BLOCKS_PER_GROUP(sb);
|
first_block += EXT4_BLOCKS_PER_GROUP(sb);
|
||||||
|
Loading…
Reference in New Issue
Block a user