diff options
Diffstat (limited to 'fs/nfs/nfs4client.c')
-rw-r--r-- | fs/nfs/nfs4client.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 4cbad5d6b276..90dce91dd5b5 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -66,6 +66,11 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) | |||
66 | if (err) | 66 | if (err) |
67 | goto error; | 67 | goto error; |
68 | 68 | ||
69 | if (cl_init->minorversion > NFS4_MAX_MINOR_VERSION) { | ||
70 | err = -EINVAL; | ||
71 | goto error; | ||
72 | } | ||
73 | |||
69 | spin_lock_init(&clp->cl_lock); | 74 | spin_lock_init(&clp->cl_lock); |
70 | INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state); | 75 | INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state); |
71 | rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client"); | 76 | rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client"); |
@@ -562,14 +567,14 @@ static bool nfs4_cb_match_client(const struct sockaddr *addr, | |||
562 | */ | 567 | */ |
563 | struct nfs_client * | 568 | struct nfs_client * |
564 | nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, | 569 | nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, |
565 | struct nfs4_sessionid *sid) | 570 | struct nfs4_sessionid *sid, u32 minorversion) |
566 | { | 571 | { |
567 | struct nfs_client *clp; | 572 | struct nfs_client *clp; |
568 | struct nfs_net *nn = net_generic(net, nfs_net_id); | 573 | struct nfs_net *nn = net_generic(net, nfs_net_id); |
569 | 574 | ||
570 | spin_lock(&nn->nfs_client_lock); | 575 | spin_lock(&nn->nfs_client_lock); |
571 | list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { | 576 | list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { |
572 | if (nfs4_cb_match_client(addr, clp, 1) == false) | 577 | if (nfs4_cb_match_client(addr, clp, minorversion) == false) |
573 | continue; | 578 | continue; |
574 | 579 | ||
575 | if (!nfs4_has_session(clp)) | 580 | if (!nfs4_has_session(clp)) |
@@ -592,7 +597,7 @@ nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, | |||
592 | 597 | ||
593 | struct nfs_client * | 598 | struct nfs_client * |
594 | nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, | 599 | nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, |
595 | struct nfs4_sessionid *sid) | 600 | struct nfs4_sessionid *sid, u32 minorversion) |
596 | { | 601 | { |
597 | return NULL; | 602 | return NULL; |
598 | } | 603 | } |
@@ -626,6 +631,8 @@ static int nfs4_set_client(struct nfs_server *server, | |||
626 | 631 | ||
627 | if (server->flags & NFS_MOUNT_NORESVPORT) | 632 | if (server->flags & NFS_MOUNT_NORESVPORT) |
628 | set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); | 633 | set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); |
634 | if (server->options & NFS_OPTION_MIGRATION) | ||
635 | set_bit(NFS_CS_MIGRATION, &cl_init.init_flags); | ||
629 | 636 | ||
630 | /* Allocate or find a client reference we can use */ | 637 | /* Allocate or find a client reference we can use */ |
631 | clp = nfs_get_client(&cl_init, timeparms, ip_addr, authflavour); | 638 | clp = nfs_get_client(&cl_init, timeparms, ip_addr, authflavour); |
@@ -730,7 +737,7 @@ static int nfs4_server_common_setup(struct nfs_server *server, | |||
730 | return -ENOMEM; | 737 | return -ENOMEM; |
731 | 738 | ||
732 | /* We must ensure the session is initialised first */ | 739 | /* We must ensure the session is initialised first */ |
733 | error = nfs4_init_session(server); | 740 | error = nfs4_init_session(server->nfs_client); |
734 | if (error < 0) | 741 | if (error < 0) |
735 | goto out; | 742 | goto out; |
736 | 743 | ||