aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/mount_clnt.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 961dc5243277..8afd9f7e7a97 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -66,7 +66,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
66 66
67 mnt_clnt = rpc_create(&args); 67 mnt_clnt = rpc_create(&args);
68 if (IS_ERR(mnt_clnt)) 68 if (IS_ERR(mnt_clnt))
69 return PTR_ERR(mnt_clnt); 69 goto out_clnt_err;
70 70
71 if (version == NFS_MNT3_VERSION) 71 if (version == NFS_MNT3_VERSION)
72 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT]; 72 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT];
@@ -75,7 +75,31 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
75 75
76 status = rpc_call_sync(mnt_clnt, &msg, 0); 76 status = rpc_call_sync(mnt_clnt, &msg, 0);
77 rpc_shutdown_client(mnt_clnt); 77 rpc_shutdown_client(mnt_clnt);
78 return status < 0? status : (result.status? -EACCES : 0); 78
79 if (status < 0)
80 goto out_call_err;
81 if (result.status != 0)
82 goto out_mnt_err;
83
84 dprintk("NFS: MNT request succeeded\n");
85 status = 0;
86
87out:
88 return status;
89
90out_clnt_err:
91 status = PTR_ERR(mnt_clnt);
92 dprintk("NFS: failed to create RPC client, status=%d\n", status);
93 goto out;
94
95out_call_err:
96 dprintk("NFS: failed to start MNT request, status=%d\n", status);
97 goto out;
98
99out_mnt_err:
100 dprintk("NFS: MNT server returned result %d\n", result.status);
101 status = -EACCES;
102 goto out;
79} 103}
80 104
81/* 105/*