]> git.neil.brown.name Git - LaFS.git/commitdiff
Mount: need to return the superblock with s_umount held.
authorNeilBrown <neilb@suse.de>
Sun, 20 Mar 2011 21:22:34 +0000 (08:22 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 20 Mar 2011 21:22:34 +0000 (08:22 +1100)
Signed-off-by: NeilBrown <neilb@suse.de>
super.c

diff --git a/super.c b/super.c
index 591f2c224041dc6edf1c4bdd7c21cde5c811f832..dcc9f381ecdd125f6a6319f5e9131416b0cb2a1f 100644 (file)
--- 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: