return ERR_CAST(mnt);
ns_private = create_mnt_ns(mnt);
- if (IS_ERR(ns_private)) {
- mntput(mnt);
+ if (IS_ERR(ns_private))
return ERR_CAST(ns_private);
- }
/*
* This will trigger the automount of the subvol so we can just
int ret;
ns_private = create_mnt_ns(root_mnt);
- ret = PTR_ERR(ns_private);
if (IS_ERR(ns_private))
- goto out_mntput;
+ return ERR_CAST(ns_private);
ret = nfs_referral_loop_protect();
- if (ret != 0)
- goto out_put_mnt_ns;
-
- ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt,
- export_path, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
+ if (ret == 0) {
+ ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt,
+ export_path, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT,
+ &path);
+ nfs_referral_loop_unprotect();
+ }
- nfs_referral_loop_unprotect();
put_mnt_ns(ns_private);
if (ret != 0)
- goto out_err;
+ return ERR_PTR(ret);
s = path.mnt->mnt_sb;
atomic_inc(&s->s_active);
path_put(&path);
down_write(&s->s_umount);
return dentry;
-out_put_mnt_ns:
- put_mnt_ns(ns_private);
-out_mntput:
- mntput(root_mnt);
-out_err:
- return ERR_PTR(ret);
}
static struct dentry *nfs4_try_mount(int flags, const char *dev_name,