diff options
author | Andy Adamson <andros@netapp.com> | 2011-02-28 20:34:12 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:41 -0500 |
commit | 94de8b27d0dcb2608d56a7e5c2941b87e6da7ce3 (patch) | |
tree | bd4b98e229bfbb9d6276e663b2eaca4c70b5bba1 | |
parent | d6fb79d433d0a34c36bdf74eaf90857193a6261f (diff) |
NFSv4.1: add MDS mount DS only check
The DS only role cannot be used to mount.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/client.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 280d41f64a57..d5c5bdfa4231 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1453,6 +1453,10 @@ static int nfs4_server_common_setup(struct nfs_server *server, | |||
1453 | BUG_ON(!server->nfs_client->rpc_ops); | 1453 | BUG_ON(!server->nfs_client->rpc_ops); |
1454 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); | 1454 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); |
1455 | 1455 | ||
1456 | /* data servers support only a subset of NFSv4.1 */ | ||
1457 | if (is_ds_only_client(server->nfs_client)) | ||
1458 | return -EPROTONOSUPPORT; | ||
1459 | |||
1456 | fattr = nfs_alloc_fattr(); | 1460 | fattr = nfs_alloc_fattr(); |
1457 | if (fattr == NULL) | 1461 | if (fattr == NULL) |
1458 | return -ENOMEM; | 1462 | return -ENOMEM; |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 1be36cf65bfc..d4cfacc40003 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -259,6 +259,13 @@ extern int nfs4_proc_destroy_session(struct nfs4_session *); | |||
259 | extern int nfs4_init_session(struct nfs_server *server); | 259 | extern int nfs4_init_session(struct nfs_server *server); |
260 | extern int nfs4_proc_get_lease_time(struct nfs_client *clp, | 260 | extern int nfs4_proc_get_lease_time(struct nfs_client *clp, |
261 | struct nfs_fsinfo *fsinfo); | 261 | struct nfs_fsinfo *fsinfo); |
262 | |||
263 | static inline bool | ||
264 | is_ds_only_client(struct nfs_client *clp) | ||
265 | { | ||
266 | return (clp->cl_exchange_flags & EXCHGID4_FLAG_MASK_PNFS) == | ||
267 | EXCHGID4_FLAG_USE_PNFS_DS; | ||
268 | } | ||
262 | #else /* CONFIG_NFS_v4_1 */ | 269 | #else /* CONFIG_NFS_v4_1 */ |
263 | static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server) | 270 | static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server) |
264 | { | 271 | { |
@@ -276,6 +283,12 @@ static inline int nfs4_init_session(struct nfs_server *server) | |||
276 | { | 283 | { |
277 | return 0; | 284 | return 0; |
278 | } | 285 | } |
286 | |||
287 | static inline bool | ||
288 | is_ds_only_client(struct nfs_client *clp) | ||
289 | { | ||
290 | return false; | ||
291 | } | ||
279 | #endif /* CONFIG_NFS_V4_1 */ | 292 | #endif /* CONFIG_NFS_V4_1 */ |
280 | 293 | ||
281 | extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; | 294 | extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; |