aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-16 21:52:06 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:52:39 -0500
commit5352d3b65ae6f38e71e16f704414c1db4b4f7228 (patch)
tree6e6e30b52e2c87264a7e1ca5880007d64b95de3f /fs/nfs/super.c
parent5ffc2836a2514e3f402327536b5dcc4a5b2d5571 (diff)
make nfs_follow_remote_path() handle ERR_PTR() passed as root_mnt
... rather than duplicating that in callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 73d87f9bab58..0e6dd56a9f1e 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2787,11 +2787,15 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt,
2787 const char *export_path) 2787 const char *export_path)
2788{ 2788{
2789 struct dentry *dentry; 2789 struct dentry *dentry;
2790 int ret = nfs_referral_loop_protect(); 2790 int err;
2791 2791
2792 if (ret) { 2792 if (IS_ERR(root_mnt))
2793 return ERR_CAST(root_mnt);
2794
2795 err = nfs_referral_loop_protect();
2796 if (err) {
2793 mntput(root_mnt); 2797 mntput(root_mnt);
2794 return ERR_PTR(ret); 2798 return ERR_PTR(err);
2795 } 2799 }
2796 2800
2797 dentry = mount_subtree(root_mnt, export_path); 2801 dentry = mount_subtree(root_mnt, export_path);
@@ -2815,9 +2819,7 @@ static struct dentry *nfs4_try_mount(int flags, const char *dev_name,
2815 data->nfs_server.hostname); 2819 data->nfs_server.hostname);
2816 data->nfs_server.export_path = export_path; 2820 data->nfs_server.export_path = export_path;
2817 2821
2818 res = ERR_CAST(root_mnt); 2822 res = nfs_follow_remote_path(root_mnt, export_path);
2819 if (!IS_ERR(root_mnt))
2820 res = nfs_follow_remote_path(root_mnt, export_path);
2821 2823
2822 dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n", 2824 dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n",
2823 IS_ERR(res) ? PTR_ERR(res) : 0, 2825 IS_ERR(res) ? PTR_ERR(res) : 0,
@@ -3078,9 +3080,7 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
3078 flags, data, data->hostname); 3080 flags, data, data->hostname);
3079 data->mnt_path = export_path; 3081 data->mnt_path = export_path;
3080 3082
3081 res = ERR_CAST(root_mnt); 3083 res = nfs_follow_remote_path(root_mnt, export_path);
3082 if (!IS_ERR(root_mnt))
3083 res = nfs_follow_remote_path(root_mnt, export_path);
3084 dprintk("<-- nfs4_referral_mount() = %ld%s\n", 3084 dprintk("<-- nfs4_referral_mount() = %ld%s\n",
3085 IS_ERR(res) ? PTR_ERR(res) : 0, 3085 IS_ERR(res) ? PTR_ERR(res) : 0,
3086 IS_ERR(res) ? " [error]" : ""); 3086 IS_ERR(res) ? " [error]" : "");