summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * NFS: Address memory leaks in the NFS client mount option parserChuck Lever2008-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | David Howells noticed that repeating the same mount option twice during an NFS mount request can result in orphaned memory in certain cases. Only the client_address and mount_server.hostname strings are initialized in the mount parsing loop, so those appear to be the only two pointers that might be written over by repeating a mount option. The strings in the nfs_server section of the nfs_parsed_mount_data structure are set only once after the options are parsed, thus these are not susceptible to being overwritten. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * nfs4: allow nfsv4 acls on non-regular-filesJ. Bruce Fields2008-01-301-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | The rfc doesn't give any reason it shouldn't be possible to set an attribute on a non-regular file. And if the server supports it, then it shouldn't be up to us to prevent it. Thanks to Erez for the report and Trond for further analysis. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Tested-by: Erez Zadok <ezk@cs.sunysb.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Optimise away the sigmask code in aio/dio reads and writesTrond Myklebust2008-01-301-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | There are no interruptible waits for asynchronous RPC tasks, so we don't need to wrap calls to rpc_run_task() with an rpc_clnt_sigmask/rpc_clnt_unsigmask pair. Instead we can wrap the wait_for_completion_interruptible() in nfs_direct_wait(). This means that we completely optimise away sigmask setting for the case of non-blocking aio/dio. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Don't bother changing the sigmask for asynchronous RPC callsTrond Myklebust2008-01-301-3/+6
| | | | | | | | | | | | | | The caller will never sleep in rpc_execute, so don't bother setting the sigmask. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: rpcb_getport_sync() passes incorrect address size to rpc_create()Chuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | | | The variable "sin" is a pointer, so sizeof(sin) is the size of a pointer, not the size of thing that sin points to. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Clean up block comment preceding rpcb_getport_sync()Chuck Lever2008-01-301-1/+4
| | | | | | | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Use appropriate argument types in rpcb clientChuck Lever2008-01-302-3/+2
| | | | | | | | | | | | | | | | | | Clean up: Follow recommendations of Chapter 5 of Documentation/CodingStyle and use "u32" instead of "__u32" for types in definitions that are not shared with user space. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: rpcb_getport_sync() should use built-in hostname generatorChuck Lever2008-01-301-3/+1
| | | | | | | | | | | | | | | | | | rpc_create() can already fill in the hostname with a string representation of the server's IP address, so remove redundant logic in in rpcb_getport_sync() that does that. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Clean up functions that free address_strings arrayChuck Lever2008-01-302-12/+20
| | | | | | | | | | | | | | | | | | Clean up: document the rule (kfree) and the exceptions (RPC_DISPLAY_PROTO and RPC_DISPLAY_NETID) when freeing the objects in a transport's address_strings array. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: NFS version number is unsignedChuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | RPC protocol version numbers are unsigned. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NLM: Fix a bogus 'return' in nlmclnt_rpc_releaseTrond Myklebust2008-01-301-1/+1
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NLM: Introduce an arguments structure for nlmclnt_init()Chuck Lever2008-01-303-26/+32
| | | | | | | | | | | | | | Clean up: pass 5 arguments to nlmclnt_init() in a structure similar to the new nfs_client_initdata structure. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
| * NLM/NFS: Use cached nlm_host when calling nlmclnt_proc()Chuck Lever2008-01-304-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that each NFS mount point caches its own nlm_host structure, it can be passed to nlmclnt_proc() for each lock request. By pinning an nlm_host for each mount point, we trade the overhead of looking up or creating a fresh nlm_host struct during every NLM procedure call for a little extra memory. We also restrict the nlmclnt_proc symbol to limit the use of this call to in-tree modules. Note that nlm_lookup_host() (just removed from the client's per-request NLM processing) could also trigger an nlm_host garbage collection. Now client-side nlm_host garbage collection occurs only during NFS mount processing. Since the NFS client now holds a reference on these nlm_host structures, they wouldn't have been affected by garbage collection anyway. Given that nlm_lookup_host() reorders the global nlm_host chain after every successful lookup, and that a garbage collection could be triggered during the call, we've removed a significant amount of per-NLM-request CPU processing overhead. Sidebar: there are only a few remaining references to the internals of NFS inodes in the client-side NLM code. The only references I found are related to extracting or comparing the inode's file handle via NFS_FH(). One is in nlmclnt_grant(); the other is in nlmclnt_setlockargs(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Invoke nlmclnt_init during NFS mount processingChuck Lever2008-01-302-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | Cache an appropriate nlm_host structure in the NFS client's mount point metadata for later use. Note that there is no need to set NFS_MOUNT_NONLM in the error case -- if nfs_start_lockd() returns a non-zero value, its callers ensure that the mount request fails outright. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NLM: Introduce external nlm_host set-up and tear-down functionsChuck Lever2008-01-302-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would like to remove the per-lock-operation nlm_lookup_host() call from nlmclnt_proc(). The new architecture pins an nlm_host structure to each NFS client superblock that has the "lock" mount option set. The NFS client passes in the pinned nlm_host structure during each call to nlmclnt_proc(). NFS client unmount processing "puts" the nlm_host so it can be garbage- collected later. This patch introduces externally callable NLM functions that handle mount-time nlm_host set up and tear-down. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Fix up constant string declarations in struct rpcbind_argsTrond Myklebust2008-01-301-7/+5
| | | | | | | | | | | | ...and eliminate an unnecessary cast. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: fewer conditionals in the format_ip_address routinesChuck Lever2008-01-305-38/+27
| | | | | | | | | | | | | | | | | | | | | | Clean up: have the set up routines explicitly pass the strings to be used for the transport name and NETID. This removes a number of conditionals and dependencies on rpc_xprt.prot, which is overloaded. Tighten up type checking on the address_strings array while we're at it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * lockd: Eliminate harmless mixed sign comparison in nlmdbg_cookie2a()Chuck Lever2008-01-301-2/+1
| | | | | | | | | | | | | | | | The cookie->len field is unsigned, so the loop index variable in nlmdbg_cookie2a() should also be unsigned. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: nfs_write_end clean upChuck Lever2008-01-301-1/+3
| | | | | | | | | | | | | | | | | | Clean up: commit 4899f9c8 added nfs_write_end(), which introduces a conditional expression that returns an unsigned integer in one arm and a signed integer in the other. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Fix minor mixed sign comparison in NFS client's write logicChuck Lever2008-01-301-1/+1
| | | | | | | | | | | | | | Clean up: PAGE_CACHE_SIZE is unsigned, and nfs_pageio_init() takes a size_t. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Use size_t for storing name lengthsChuck Lever2008-01-301-3/+3
| | | | | | | | | | | | | | | | Clean up: always use the same type when handling buffer lengths. As a bonus, this prevents a mixed sign comparison in idmap_lookup_name. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Fix use of copy_to_user() in idmap_pipe_upcallChuck Lever2008-01-301-8/+6
| | | | | | | | | | | | | | | | | | The idmap_pipe_upcall() function expects the copy_to_user() function to return a negative error value if the call fails, but copy_to_user() returns an unsigned long number of bytes that couldn't be copied. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Clean up fs/nfs/idmap.cChuck Lever2008-01-301-43/+44
| | | | | | | | | | | | | | | | Clean up white space damage and use standard kernel coding conventions for return statements. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Fix use of copy_to_user() in gss_pipe_upcall()Chuck Lever2008-01-301-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The gss_pipe_upcall() function expects the copy_to_user() function to return a negative error value if the call fails, but copy_to_user() returns an unsigned long number of bytes that couldn't be copied. Can rpc_pipefs actually retry a partially completed upcall read? If not, then gss_pipe_upcall() should punt any partial read, just like the upcall logic in net/sunrpc/cache.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Fix the 'proto=' mount optionTrond Myklebust2008-01-302-7/+14
| | | | | | | | | | | | | | | | Currently, if you have a server mounted using networking protocol, you cannot specify a different value using the 'proto=' option on another mountpoint. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Support per-mountpoint timeout parameters.Trond Myklebust2008-01-303-39/+49
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Ensure that we respect NFS_MAX_TCP_TIMEOUTTrond Myklebust2008-01-301-1/+5
| | | | | | | | | | | | | | It isn't sufficient just to limit timeout->to_initval, we also need to limit to_maxval. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Add support for per-client timeout valuesTrond Myklebust2008-01-306-21/+22
| | | | | | | | | | | | | | | | In order to be able to support setting the timeo and retrans parameters on a per-mountpoint basis, we move the rpc_timeout structure into the rpc_clnt. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Clean up the transport timeout initialisationTrond Myklebust2008-01-304-31/+27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: cleanup for rpc_new_client()Trond Myklebust2008-01-301-10/+14
| | | | | | | | | | | | There is no reason why we shouldn't just pass the rpc_create_args. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFSv4: Add socket proto argument to setclientidTrond Myklebust2008-01-302-2/+4
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Pull covers off IPv6 address parsingChuck Lever2008-01-301-5/+16
| | | | | | | | | | | | | | | | Now that the needed IPv6 infrastructure is in place, allow the NFS client's IP address parser to generate AF_INET6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * 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>
OpenPOWER on IntegriCloud