diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
commit | 86d710146fb9975f04c505ec78caa43d227c1018 (patch) | |
tree | c7f95412b7760e6b7e3c15eab8b2ac944256d7ac /fs/nfs/nfs4namespace.c | |
parent | 86373435d2299b722ec87c416005953215f049c1 (diff) | |
parent | ab3bbaa8b257845e248e9a01d12a69ca245f4197 (diff) |
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (87 commits)
NFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'
NFS: Allow the "nfs" file system type to support NFSv4
NFS: Move details of nfs4_get_sb() to a helper
NFS: Refactor NFSv4 text-based mount option validation
NFS: Mount option parser should detect missing "port="
NFS: out of date comment regarding O_EXCL above nfs3_proc_create()
NFS: Handle a zero-length auth flavor list
SUNRPC: Ensure that sunrpc gets initialised before nfs, lockd, etc...
nfs: fix compile error in rpc_pipefs.h
nfs: Remove reference to generic_osync_inode from a comment
SUNRPC: cache must take a reference to the cache detail's module on open()
NFS: Use the DNS resolver in the mount code.
NFS: Add a dns resolver for use with NFSv4 referrals and migration
SUNRPC: Fix a typo in cache_pipefs_files
nfs: nfs4xdr: optimize low level decoding
nfs: nfs4xdr: get rid of READ_BUF
nfs: nfs4xdr: simplify decode_exchange_id by reusing decode_opaque_inline
nfs: nfs4xdr: get rid of COPYMEM
nfs: nfs4xdr: introduce decode_sessionid helper
nfs: nfs4xdr: introduce decode_verifier helper
...
Diffstat (limited to 'fs/nfs/nfs4namespace.c')
-rw-r--r-- | fs/nfs/nfs4namespace.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 2a2a0a7143ad..2636c26d56fa 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/inet.h> | 17 | #include <linux/inet.h> |
18 | #include "internal.h" | 18 | #include "internal.h" |
19 | #include "nfs4_fs.h" | 19 | #include "nfs4_fs.h" |
20 | #include "dns_resolve.h" | ||
20 | 21 | ||
21 | #define NFSDBG_FACILITY NFSDBG_VFS | 22 | #define NFSDBG_FACILITY NFSDBG_VFS |
22 | 23 | ||
@@ -95,6 +96,20 @@ static int nfs4_validate_fspath(const struct vfsmount *mnt_parent, | |||
95 | return 0; | 96 | return 0; |
96 | } | 97 | } |
97 | 98 | ||
99 | static size_t nfs_parse_server_name(char *string, size_t len, | ||
100 | struct sockaddr *sa, size_t salen) | ||
101 | { | ||
102 | ssize_t ret; | ||
103 | |||
104 | ret = rpc_pton(string, len, sa, salen); | ||
105 | if (ret == 0) { | ||
106 | ret = nfs_dns_resolve_name(string, len, sa, salen); | ||
107 | if (ret < 0) | ||
108 | ret = 0; | ||
109 | } | ||
110 | return ret; | ||
111 | } | ||
112 | |||
98 | static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, | 113 | static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, |
99 | char *page, char *page2, | 114 | char *page, char *page2, |
100 | const struct nfs4_fs_location *location) | 115 | const struct nfs4_fs_location *location) |
@@ -121,11 +136,12 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, | |||
121 | 136 | ||
122 | if (memchr(buf->data, IPV6_SCOPE_DELIMITER, buf->len)) | 137 | if (memchr(buf->data, IPV6_SCOPE_DELIMITER, buf->len)) |
123 | continue; | 138 | continue; |
124 | nfs_parse_ip_address(buf->data, buf->len, | 139 | mountdata->addrlen = nfs_parse_server_name(buf->data, |
125 | mountdata->addr, &mountdata->addrlen); | 140 | buf->len, |
126 | if (mountdata->addr->sa_family == AF_UNSPEC) | 141 | mountdata->addr, mountdata->addrlen); |
142 | if (mountdata->addrlen == 0) | ||
127 | continue; | 143 | continue; |
128 | nfs_set_port(mountdata->addr, NFS_PORT); | 144 | rpc_set_port(mountdata->addr, NFS_PORT); |
129 | 145 | ||
130 | memcpy(page2, buf->data, buf->len); | 146 | memcpy(page2, buf->data, buf->len); |
131 | page2[buf->len] = '\0'; | 147 | page2[buf->len] = '\0'; |