aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-30 19:33:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-30 19:33:25 -0400
commit7f155c702677d057d03b192ce652311de5434697 (patch)
treedcee0fbb463ec3e55cb50181180c7d175d5895c3 /fs/nfs/client.c
parentd761f3ed6e71bcca724a6e9e39efcac65b7b4ac1 (diff)
parent944171cbf499d3445c749f7c13c46de0a564a905 (diff)
Merge tag 'nfs-for-4.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: Stable bugfixes: - nfs: don't create zero-length requests - several LAYOUTGET bugfixes Features: - several performance related features - more aggressive caching when we can rely on close-to-open cache consistency - remove serialisation of O_DIRECT reads and writes - optimise several code paths to not flush to disk unnecessarily. However allow for the idiosyncracies of pNFS for those layout types that need to issue a LAYOUTCOMMIT before the metadata can be updated on the server. - SUNRPC updates to the client data receive path - pNFS/SCSI support RH/Fedora dm-mpath device nodes - pNFS files/flexfiles can now use unprivileged ports when the generic NFS mount options allow it. Bugfixes: - Don't use RDMA direct data placement together with data integrity or privacy security flavours - Remove the RDMA ALLPHYSICAL memory registration mode as it has potential security holes. - Several layout recall fixes to improve NFSv4.1 protocol compliance. - Fix an Oops in the pNFS files and flexfiles connection setup to the DS - Allow retry of operations that used a returned delegation stateid - Don't mark the inode as revalidated if a LAYOUTCOMMIT is outstanding - Fix writeback races in nfs4_copy_range() and nfs42_proc_deallocate()" * tag 'nfs-for-4.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (104 commits) pNFS: Actively set attributes as invalid if LAYOUTCOMMIT is outstanding NFSv4: Clean up lookup of SECINFO_NO_NAME NFSv4.2: Fix warning "variable ‘stateids’ set but not used" NFSv4: Fix warning "no previous prototype for ‘nfs4_listxattr’" SUNRPC: Fix a compiler warning in fs/nfs/clnt.c pNFS: Remove redundant smp_mb() from pnfs_init_lseg() pNFS: Cleanup - do layout segment initialisation in one place pNFS: Remove redundant stateid invalidation pNFS: Remove redundant pnfs_mark_layout_returned_if_empty() pNFS: Clear the layout metadata if the server changed the layout stateid pNFS: Cleanup - don't open code pnfs_mark_layout_stateid_invalid() NFS: pnfs_mark_matching_lsegs_return() should match the layout sequence id pNFS: Do not set plh_return_seq for non-callback related layoutreturns pNFS: Ensure layoutreturn acts as a completion for layout callbacks pNFS: Fix CB_LAYOUTRECALL stateid verification pNFS: Always update the layout barrier seqid on LAYOUTGET pNFS: Always update the layout stateid if NFS_LAYOUT_INVALID_STID is set pNFS: Clear the layout return tracking on layout reinitialisation pNFS: LAYOUTRETURN should only update the stateid if the layout is valid nfs: don't create zero-length requests ...
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 487c5607d52f..003ebce4bbc4 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -367,8 +367,6 @@ nfs_found_client(const struct nfs_client_initdata *cl_init,
367 */ 367 */
368struct nfs_client * 368struct nfs_client *
369nfs_get_client(const struct nfs_client_initdata *cl_init, 369nfs_get_client(const struct nfs_client_initdata *cl_init,
370 const struct rpc_timeout *timeparms,
371 const char *ip_addr,
372 rpc_authflavor_t authflavour) 370 rpc_authflavor_t authflavour)
373{ 371{
374 struct nfs_client *clp, *new = NULL; 372 struct nfs_client *clp, *new = NULL;
@@ -399,7 +397,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init,
399 &nn->nfs_client_list); 397 &nn->nfs_client_list);
400 spin_unlock(&nn->nfs_client_lock); 398 spin_unlock(&nn->nfs_client_lock);
401 new->cl_flags = cl_init->init_flags; 399 new->cl_flags = cl_init->init_flags;
402 return rpc_ops->init_client(new, timeparms, ip_addr); 400 return rpc_ops->init_client(new, cl_init);
403 } 401 }
404 402
405 spin_unlock(&nn->nfs_client_lock); 403 spin_unlock(&nn->nfs_client_lock);
@@ -470,7 +468,7 @@ EXPORT_SYMBOL_GPL(nfs_init_timeout_values);
470 * Create an RPC client handle 468 * Create an RPC client handle
471 */ 469 */
472int nfs_create_rpc_client(struct nfs_client *clp, 470int nfs_create_rpc_client(struct nfs_client *clp,
473 const struct rpc_timeout *timeparms, 471 const struct nfs_client_initdata *cl_init,
474 rpc_authflavor_t flavor) 472 rpc_authflavor_t flavor)
475{ 473{
476 struct rpc_clnt *clnt = NULL; 474 struct rpc_clnt *clnt = NULL;
@@ -479,8 +477,9 @@ int nfs_create_rpc_client(struct nfs_client *clp,
479 .protocol = clp->cl_proto, 477 .protocol = clp->cl_proto,
480 .address = (struct sockaddr *)&clp->cl_addr, 478 .address = (struct sockaddr *)&clp->cl_addr,
481 .addrsize = clp->cl_addrlen, 479 .addrsize = clp->cl_addrlen,
482 .timeout = timeparms, 480 .timeout = cl_init->timeparms,
483 .servername = clp->cl_hostname, 481 .servername = clp->cl_hostname,
482 .nodename = cl_init->nodename,
484 .program = &nfs_program, 483 .program = &nfs_program,
485 .version = clp->rpc_ops->version, 484 .version = clp->rpc_ops->version,
486 .authflavor = flavor, 485 .authflavor = flavor,
@@ -591,14 +590,12 @@ EXPORT_SYMBOL_GPL(nfs_init_server_rpcclient);
591 * nfs_init_client - Initialise an NFS2 or NFS3 client 590 * nfs_init_client - Initialise an NFS2 or NFS3 client
592 * 591 *
593 * @clp: nfs_client to initialise 592 * @clp: nfs_client to initialise
594 * @timeparms: timeout parameters for underlying RPC transport 593 * @cl_init: Initialisation parameters
595 * @ip_addr: IP presentation address (not used)
596 * 594 *
597 * Returns pointer to an NFS client, or an ERR_PTR value. 595 * Returns pointer to an NFS client, or an ERR_PTR value.
598 */ 596 */
599struct nfs_client *nfs_init_client(struct nfs_client *clp, 597struct nfs_client *nfs_init_client(struct nfs_client *clp,
600 const struct rpc_timeout *timeparms, 598 const struct nfs_client_initdata *cl_init)
601 const char *ip_addr)
602{ 599{
603 int error; 600 int error;
604 601
@@ -612,7 +609,7 @@ struct nfs_client *nfs_init_client(struct nfs_client *clp,
612 * Create a client RPC handle for doing FSSTAT with UNIX auth only 609 * Create a client RPC handle for doing FSSTAT with UNIX auth only
613 * - RFC 2623, sec 2.3.2 610 * - RFC 2623, sec 2.3.2
614 */ 611 */
615 error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_UNIX); 612 error = nfs_create_rpc_client(clp, cl_init, RPC_AUTH_UNIX);
616 if (error < 0) 613 if (error < 0)
617 goto error; 614 goto error;
618 nfs_mark_client_ready(clp, NFS_CS_READY); 615 nfs_mark_client_ready(clp, NFS_CS_READY);
@@ -633,6 +630,7 @@ static int nfs_init_server(struct nfs_server *server,
633 const struct nfs_parsed_mount_data *data, 630 const struct nfs_parsed_mount_data *data,
634 struct nfs_subversion *nfs_mod) 631 struct nfs_subversion *nfs_mod)
635{ 632{
633 struct rpc_timeout timeparms;
636 struct nfs_client_initdata cl_init = { 634 struct nfs_client_initdata cl_init = {
637 .hostname = data->nfs_server.hostname, 635 .hostname = data->nfs_server.hostname,
638 .addr = (const struct sockaddr *)&data->nfs_server.address, 636 .addr = (const struct sockaddr *)&data->nfs_server.address,
@@ -640,8 +638,8 @@ static int nfs_init_server(struct nfs_server *server,
640 .nfs_mod = nfs_mod, 638 .nfs_mod = nfs_mod,
641 .proto = data->nfs_server.protocol, 639 .proto = data->nfs_server.protocol,
642 .net = data->net, 640 .net = data->net,
641 .timeparms = &timeparms,
643 }; 642 };
644 struct rpc_timeout timeparms;
645 struct nfs_client *clp; 643 struct nfs_client *clp;
646 int error; 644 int error;
647 645
@@ -653,7 +651,7 @@ static int nfs_init_server(struct nfs_server *server,
653 set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); 651 set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
654 652
655 /* Allocate or find a client reference we can use */ 653 /* Allocate or find a client reference we can use */
656 clp = nfs_get_client(&cl_init, &timeparms, NULL, RPC_AUTH_UNIX); 654 clp = nfs_get_client(&cl_init, RPC_AUTH_UNIX);
657 if (IS_ERR(clp)) { 655 if (IS_ERR(clp)) {
658 dprintk("<-- nfs_init_server() = error %ld\n", PTR_ERR(clp)); 656 dprintk("<-- nfs_init_server() = error %ld\n", PTR_ERR(clp));
659 return PTR_ERR(clp); 657 return PTR_ERR(clp);