Btrfs: Fix a crash when mounting a subvolume
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 7 Dec 2010 01:51:26 +0000 (01:51 +0000)
committerChris Mason <chris.mason@oracle.com>
Fri, 10 Dec 2010 21:29:10 +0000 (16:29 -0500)
We should drop dentry before deactivating the superblock, otherwise
we can hit this bug:

BUG: Dentry f349a690{i=100,n=/} still in use (1) [unmount of btrfs loop1]
...

Steps to reproduce the bug:

  # mount /dev/loop1 /mnt
  # mkdir save
  # btrfs subvolume snapshot /mnt save/snap1
  # umount /mnt
  # mount -o subvol=save/snap1 /dev/loop1 /mnt
  (crash)

Reported-by: Michael Niederle <mniederle@gmx.at>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

No differences found