]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: remove BUG_ON() due to mounting bad filesystem
authorMiao Xie <miaox@cn.fujitsu.com>
Tue, 2 Feb 2010 08:46:44 +0000 (08:46 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:20:11 +0000 (13:20 -0700)
commit4c324840d6c06406e1f05e12952c050c4e84ce95
tree9ada20732625bc8b1fbfa6a9fda5e58f3290e5c0
parentcaf32f2c7d0f78eead8cb38a86dfa1bff6ded600
Btrfs: remove BUG_ON() due to mounting bad filesystem

commit d7ce5843bb28ada6845ab2ae8510ba3f12d33154 upstream.

Mounting a bad filesystem caused a BUG_ON(). The following is steps to
reproduce it.
 # mkfs.btrfs /dev/sda2
 # mount /dev/sda2 /mnt
 # mkfs.btrfs /dev/sda1 /dev/sda2
 (the program says that /dev/sda2 was mounted, and then exits. )
 # umount /mnt
 # mount /dev/sda1 /mnt

At the third step, mkfs.btrfs exited in the way of make filesystem. So the
initialization of the filesystem didn't finish. So the filesystem was bad, and
it caused BUG_ON() when mounting it. But BUG_ON() should be called by the wrong
code, not user's operation, so I think it is a bug of btrfs.

This patch fixes it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/btrfs/disk-io.c
fs/btrfs/relocation.c