summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-09-08 10:47:19 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-09-08 10:47:19 -0400
commit7ee1ec4ca30c6df8e989615cdaacb75f2af4fa6b (patch)
tree6d097319a8020d53543af86dfd19ffbbb0110b6e /fs/ext4
parent05496769e5da83ce22ed97345afd9c7b71d6bd24 (diff)
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 64e1c21eb5d..8175318abd8 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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)