From 63fb64bfee93155611b130a042498b51e9838c47 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 21 Mar 2011 08:22:34 +1100 Subject: [PATCH] Mount: need to return the superblock with s_umount held. Signed-off-by: NeilBrown --- super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/super.c b/super.c index 591f2c2..dcc9f38 100644 --- a/super.c +++ b/super.c @@ -1077,6 +1077,7 @@ lafs_get_subset(struct file_system_type *fs_type, LAFSI(ino)->type != TypeDir) goto out; fs = fs_from_sb(sb); + down_write(&sb->s_umount); mutex_lock(&ino->i_mutex); err = 0; if (LAFSI(ino)->type == TypeDir) { @@ -1147,12 +1148,14 @@ lafs_get_subset(struct file_system_type *fs_type, if (IS_ERR(root)) err = PTR_ERR(root); else { - mnt->mnt_sb = fs->prime_sb; + mnt->mnt_sb = root->d_sb; atomic_inc(&mnt->mnt_sb->s_active); mnt->mnt_root = root; } out_unlock: mutex_unlock(&ino->i_mutex); + if (err) + up_write(&ino->i_sb->s_umount); out: path_put(&nd.path); out_noput: -- 2.43.0