public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-ext4@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ext4: miss an unlock in ext4_check_descriptors()
Date: Mon, 08 Sep 2008 15:33:34 +0800	[thread overview]
Message-ID: <48C4D54E.60909@cn.fujitsu.com> (raw)

 # mkfs.ext3 -m 0 /dev/sda6
 # tune2fs -E test_fs -O extents,uninit_bg
 (no e2fsck after tune2fs)
 # mount -t ext4dev /dev/sda6

oops immediately:

EXT4-fs: ext4_check_descriptors: Checksum for group 0 failed (20091!=0)
EXT4-fs: group descriptors corrupted!

=========================
[ BUG: held lock freed! ]
-------------------------
mount/9422 is freeing memory c6ca0000-c6ca7fff, with a lock still held there!
 (&bgl->locks[i].lock#2){--..}, at: [<f8996589>] ext4_fill_super+0xde8/0x1dcf [ext4dev]
2 locks held by mount/9422:
 #0:  (&type->s_umount_key#19){----}, at: [<c0488258>] sget+0x1dd/0x31c
 #1:  (&bgl->locks[i].lock#2){--..}, at: [<f8996589>] ext4_fill_super+0xde8/0x1dcf [ext4dev]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 fs/ext4/super.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 566344b..24e7df6 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)
-- 1.5.4.rc3 

             reply	other threads:[~2008-09-08  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  7:33 Li Zefan [this message]
2008-09-08 14:47 ` [PATCH] ext4: miss an unlock in ext4_check_descriptors() Theodore Tso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C4D54E.60909@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox