From: NeilBrown Date: Sun, 20 Mar 2011 21:22:34 +0000 (+1100) Subject: Mount: need to return the superblock with s_umount held. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=63fb64bfee93155611b130a042498b51e9838c47;p=LaFS.git Mount: need to return the superblock with s_umount held. Signed-off-by: NeilBrown --- 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: