diff mbox

Btrfs: Fix a crash when mounting a subvolume

Message ID 4CFD931E.6050503@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Li Zefan Dec. 7, 2010, 1:51 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 47bf67c..61bd79a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -685,9 +685,9 @@  static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 		mutex_unlock(&root->d_inode->i_mutex);
 
 		if (IS_ERR(new_root)) {
+			dput(root);
 			deactivate_locked_super(s);
 			error = PTR_ERR(new_root);
-			dput(root);
 			goto error_free_subvol_name;
 		}
 		if (!new_root->d_inode) {