aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * NFS: Support non-IPv4 addresses in nfs_parsed_mount_dataChuck Lever2008-01-303-24/+40
| | | | | | | | | | | | | | | | | | | | Replace the nfs_server and mount_server address fields in the nfs_parsed_mount_data structure with a "struct sockaddr_storage" instead of a "struct sockaddr_in". Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Refactor mount option address parsing into separate functionChuck Lever2008-01-301-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the logic to parse incoming text-based IP addresses. Use the in4_pton() function instead of the older in_aton(), following the lead of the in-kernel CIFS client. Later we'll add IPv6 address parsing using the matching in6_pton() function. For now we can't allow IPv6 address parsing: we must expand the size of the address storage fields in the nfs_parsed_mount_options struct before we can parse and store IPv6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Remove the NIPQUAD from nfs_try_mountChuck Lever2008-01-301-5/+18
| | | | | | | | | | | | | | | | | | | | In the name of address family compatibility, we can't have the NIP_FMT and NIPQUAD macros in nfs_try_mount(). Instead, we can make use of an unused mount option to display the mount server's hostname. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Adjust nfs_clone_mount structure to store "struct sockaddr *"Chuck Lever2008-01-303-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the addr field in the nfs_clone_mount structure to store a "struct sockaddr *" to support non-IPv4 addresses in the NFS client. Note this is mostly a cosmetic change, and does not actually allow referrals using IPv6 addresses. The existing referral code assumes that the server returns a string that represents an IPv4 address. This code needs to support hostnames and IPv6 addresses as well as IPv4 addresses, thus it will need to be reorganized completely (to handle DNS resolution in user space). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change nfs4_set_client() to accept struct sockaddr *Chuck Lever2008-01-301-10/+15
| | | | | | | | | | | | | | | | | | | | Adjust the arguments and callers of nfs4_set_client() to pass a "struct sockaddr *" instead of a "struct sockaddr_in *" to support non-IPv4 addresses in the NFS client. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change nfs_get_client() to take sockaddr *Chuck Lever2008-01-301-6/+5
| | | | | | | | | | | | | | | | | | | | Adjust arguments and callers of nfs_get_client() to pass a "struct sockaddr *" instead of "struct sockaddr_in *" to support non-IPv4 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change nfs_find_client() to take "struct sockaddr *"Chuck Lever2008-01-304-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust arguments and callers of nfs_find_client() to pass a "struct sockaddr *" instead of "struct sockaddr_in *" to support non-IPv4 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Trond: Also fix up protocol version number argument in nfs_find_client() to use the correct u32 type. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change cb_recallargs to pass "struct sockaddr *" instead of sockaddr_inChuck Lever2008-01-303-3/+3
| | | | | | | | | | | | | | | | | | Change the addr field in the cb_recallargs struct to a "struct sockaddr *" to support non-IPv4 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change cb_getattrargs to pass "struct sockaddr *" instead of sockaddr_inChuck Lever2008-01-303-3/+3
| | | | | | | | | | | | | | | | | | Change the addr field in the cb_getattrargs struct to a "struct sockaddr *" to support non-IPv4 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Expand server address storage in nfs_client structChuck Lever2008-01-302-3/+8
| | | | | | | | | | | | | | | | | | | | | | Prepare for managing larger addresses in the NFS client by widening the nfs_client struct's cl_addr field. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> (Modified to work with the new parameters for nfs_alloc_client) Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Add support for AF_INET6 addresses in __nfs_find_client()Trond Myklebust2008-01-301-2/+39
| | | | | | | | | | | | Introduce AF_INET6-specific address checking to __nfs_find_client(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Set default port for NFSv4, with support for AF_INET6Chuck Lever2008-01-301-4/+28
| | | | | | | | | | | | | | | | Create a helper function to set the default NFS port for NFSv4 mount points. The helper supports both AF_INET and AF_INET6 family addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Make setting a port number agosticChuck Lever2008-01-301-2/+24
| | | | | | | | | | | | | | | | | | We'll need to set the port number of an AF_INET or AF_INET6 address in several places in fs/nfs/super.c, so introduce a helper that can manage this for us. We put this helper to immediate use. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Verify IPv6 addresses properlyChuck Lever2008-01-301-5/+10
| | | | | | | | | | | | | | | | Add support to nfs_verify_server_address for recognizing AF_INET6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Add support for AF_INET6 addresses in nfs_compare_super()Chuck Lever2008-01-301-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor nfs_compare_super() and add AF_INET6 support. Replace the generic memcmp() to document explicitly what parts of the addresses must match in this check, and make the comparison independent of the lengths of both addresses. A side benefit is both tests are more computationally efficient than a memcmp(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Address a couple of nits in nfs_follow_referral()Chuck Lever2008-01-301-5/+3
| | | | | | | | | | | | | | | | Clean up: fix an outdated block comment, and address a comparison between a signed and unsigned integer. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Move dprintks from callback.c to callback_proc.cChuck Lever2008-01-302-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Clean up: The client side peer address is available in callback_proc.c, so move a dprintk out of fs/nfs/callback.c and into fs/nfs/callback_proc.c. This is more consistent with other debugging messages, and the proc routines have more information about each request to display. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: eliminate NIPQUAD(clp->cl_addr.sin_addr)Chuck Lever2008-01-304-16/+20
| | | | | | | | | | | | | | | | | | | | | | To ensure the NFS client displays IPv6 addresses properly, replace address family-specific NIPQUAD() invocations with a call to the RPC client to get a formatted string representing the remote peer's address. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Enable NFS client to generate CLIENTID strings with IPv6 addressesChuck Lever2008-01-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | We recently added methods to RPC transports that provide string versions of the remote peer address information. Convert the NFSv4 SETCLIENTID procedure to use those methods instead of building the client ID out of whole cloth. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Increase size of cl_ipaddr field to hold IPv6 addressesChuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | | | | | The nfs_client's cl_ipaddr field needs to be larger to hold strings that represent IPv6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Ensure NFSv4 SETCLIENTID send buffer is large enoughChuck Lever2008-01-302-10/+13
| | | | | | | | | | | | | | | | | | Ensure that the RPC buffer size specified for NFSv4 SETCLIENTID procedures matches what we are encoding into the buffer. See the definition of struct nfs4_setclientid {} and the encode_setclientid() function. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Move universal address definitions to global headerChuck Lever2008-01-302-42/+42
| | | | | | | | | | | | | | | | | | | | Universal addresses are defined in RFC 1833 and clarified in RFC 3530. We need to use them in several places in the NFS and RPC clients, so move the relevant definition and block comment to an appropriate global include file. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: RPC version numbers are u32Chuck Lever2008-01-301-2/+2
| | | | | | | | | | | | | | Clean up: use correct type for RPC version numbers in rpcbind client. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Fix socket address handling in rpcb_clntChuck Lever2008-01-301-8/+12
| | | | | | | | | | | | | | Make sure rpcb_clnt passes the correct address length to rpc_create(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: rpc_create() default hostname should support AF_INET6 addressesChuck Lever2008-01-301-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | If the ULP doesn't pass a hostname string to rpc_create(), it manufactures one based on the passed-in address. Be smart enough to handle an AF_INET6 address properly in this case. Move the default servername logic before the xprt_create_transport() call to simplify error handling in rpc_create(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Remove the redundant nfs_client->cl_nfsversionTrond Myklebust2008-01-304-26/+20
| | | | | | | | | | | | We can get the same information from the rpc_ops structure instead. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Clean up the nfs_find_client function.Trond Myklebust2008-01-301-22/+30
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Clean up the nfs_client initialisationTrond Myklebust2008-01-301-20/+31
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: define a function to update nfsi->cache_change_attributeTrond Myklebust2008-01-304-3/+21
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Remove an unneeded check in decode_compound_header_arg()Chuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | | | Clean up: The header tag length is unsigned, so checking that it is less than zero is unnecessary. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Clean up address comparison in __nfs_find_client()Chuck Lever2008-01-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The address comparison in the __nfs_find_client() function is deceptive. It uses a memcmp() to check a pair of u32 fields for equality. Not only is this inefficient, but usually memcmp() is used for comparing two *whole* sockaddr_in's (which includes comparisons of the address family and port number), so it's easy to mistake the comparison here for a whole sockaddr comparison, which it isn't. So for clarity and efficiency, we replace the memcmp() with a simple test for equality between the two s_addr fields. This should have no behavioral effect. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Clean up: copy hostname with kstrndup during mount processingChuck Lever2008-01-301-9/+4
| | | | | | | | | | | | | | | | | | Clean up: mount option parsing uses kstrndup in several places, rather than using kzalloc. Replace the few remaining uses of kzalloc with kstrndup, for consistency. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Remove support for the 'mountprog' optionChuck Lever2008-01-302-11/+1
| | | | | | | | | | | | | | | | | | Remove the mount option that allows users to specify an alternate mountd program number. The client hasn't support setting an alternate mountd program number for a very long time. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Remove support for the 'nfsprog' optionChuck Lever2008-01-302-14/+1
| | | | | | | | | | | | | | | | | | Remove the mount option that allows users to specify an alternate NFS program number. The client hasn't support setting an alternate NFS program number for a very long time. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Ensure that NFS version 4 mounts use NFS_PORT if nfsport wasn't setChuck Lever2008-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Text-based mount option parsing introduced a minor regression in the behavior of NFS version 4 mounts. NFS version 4 is not supposed to require a running rpcbind service on the server in order for a mount to succeed. In other words, if the mount options don't specify a port number, the port number is supposed to default to 2049. For earlier versions of NFS, the default port number was zero in order to cause the RPC client to autobind to the server's NFS service. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Prevent nfs_getattr() hang during heavy write workloadsChuck Lever2008-01-301-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX requires that ctime and mtime, as reported by the stat(2) call, reflect the activity of the most recent write(2). To that end, nfs_getattr() flushes pending dirty writes to a file before doing a GETATTR to allow the NFS server to set the file's size, ctime, and mtime properly. However, nfs_getattr() can be starved when a constant stream of application writes to a file prevents nfs_wb_nocommit() from completing. This usually results in hangs of programs doing a stat against an NFS file that is being written. "ls -l" is a common victim of this behavior. To prevent starvation, hold the file's i_mutex in nfs_getattr() to freeze applications writes temporarily so the client can more quickly obtain clean values for a file's size, mtime, and ctime. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Change sign of some loop indices in nfs4xdr.cChuck Lever2008-01-301-8/+8
| | | | | | | | | | | | | | Nit: Eliminate some mixed sign comparisons in loop indices. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Use unsigned intermediates for manipulating header lengths (NFSv4 XDR)Chuck Lever2008-01-301-5/+9
| | | | | | | | | | | | | | | | Clean up: prevent length underflow and mixed sign comparison when unmarshalling NFS version 4 getacl, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Use unsigned intermediates for manipulating header lengths (NFSv3 XDR)Chuck Lever2008-01-301-12/+15
| | | | | | | | | | | | | | | | Clean up: prevent length underflow and mixed sign comparisons when unmarshalling NFS version 3 read, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Use unsigned intermediates for manipulating header lengths (NFSv2 XDR)Chuck Lever2008-01-301-10/+14
| | | | | | | | | | | | | | | | Clean up: prevent length underflow and mixed sign comparisons when unmarshalling NFS version 2 read, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Ensure nfs_wcc_update_inode always converts file size to loff_tChuck Lever2008-01-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The nfs_wcc_update_inode() function omits logic to convert the type of the NFS on-the-wire value of a file's size (__u64) to the type of file size value stored in struct inode (loff_t, which is signed). Everywhere else in the NFS client I checked already correctly converts the file size type. This effects only very large files. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Remove an unneeded implicit type cast when calling rpc_depopulate()Chuck Lever2008-01-301-2/+2
| | | | | | | | | | | | | | | | The two arguments of rpc_depopulate() that pass in inode numbers should use the same type as inode->i_ino: unsigned long. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: temp var should match return type of xdr_skb_read_actorChuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | | | The return type of xdr_skb_read_actor functions is size_t. This fixes a nit I unwittingly overlooked in commit dd456471. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Check a return resultChuck Lever2008-01-301-3/+5
| | | | | | | | | | | | | | | | Minor: Replace an empty if statement with a debugging dprintk. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Fix an unnecessary implicit type cast in rpcrdma_count_chunks()Chuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | Nit: rl_nchunks is an unsigned integer, so pass it into rpcrdma_count_chunks() via an unsigned integer argument. This eliminates a harmless mixed sign comparison in rpcrdma_count_chunks() Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Prevent mixed sign comparisons in rpcrdma_convert_iovs()Chuck Lever2008-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | Keep the type of the buffer position the same during iovec conversion to reduce the likelihood of unexpected results from comparisons and length computations. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Remove the obsolete RPC_WAITQ macroTrond Myklebust2008-01-301-23/+0
| | | | | | | | | | | | Now that we've killed off all the users. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Cleanup to remove the last users of the RPC_WAITQ declarationTrond Myklebust2008-01-301-1/+6
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Unexport rpc_init_task() and rpc_execute()Trond Myklebust2008-01-302-4/+1
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task()Trond Myklebust2008-01-303-34/+35
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>