summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'nfs-for-2.6.32'Trond Myklebust2009-09-1114-800/+1780
|\
| * SUNRPC: Ensure that sunrpc gets initialised before nfs, lockd, etc...Trond Myklebust2009-08-211-1/+1
| | | | | | | | | | | | | | We can oops if rpc_pipefs isn't properly initialised before we start to set up objects that depend upon it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: cache must take a reference to the cache detail's module on open()Trond Myklebust2009-08-201-4/+76
| | | | | | | | | | | | | | Otherwise we Oops if the module containing the cache detail is removed before all cache readers have closed the file. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * NFS: Add a dns resolver for use with NFSv4 referrals and migrationTrond Myklebust2009-08-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The NFSv4 and NFSv4.1 protocols both allow for the redirection of a client from one server to another in order to support filesystem migration and replication. For full protocol support, we need to add the ability to convert a DNS host name into an IP address that we can feed to the RPC client. We'll reuse the sunrpc cache, now that it has been converted to work with rpc_pipefs. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * SUNRPC: Fix a typo in cache_pipefs_filesTrond Myklebust2009-08-201-1/+1
| | | | | | | | | | | | | | We want the channel to be a regular file, so that we don't need to supply rpc_pipe_ops. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * Merge branch 'nfsv4_xdr_cleanups-for-2.6.32' into nfs-for-2.6.32Trond Myklebust2009-08-201-6/+6
| |\ | | | | | | | | | | | | Conflicts: fs/nfs/nfs4xdr.c
| | * sunrpc: ntoh -> be*_to_cpuBenny Halevy2009-08-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | ntohl is already defined as be32_to_cpu. be64_to_cpu has architecture specific optimized implementations. Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * sunrpc: hton -> cpu_to_be*Benny Halevy2009-08-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | htonl is already defined as cpu_to_be32. cpu_to_be64 has architecture specific optimized implementations. Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * | Merge branch 'sunrpc_cache-for-2.6.32' into nfs-for-2.6.32Trond Myklebust2009-08-106-463/+858
| |\ \
| | * | SUNRPC: Add an rpc_pipefs front end for the sunrpc cache codeTrond Myklebust2009-08-092-0/+169
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Move procfs-specific stuff out of the generic sunrpc cache codeTrond Myklebust2009-08-091-129/+190
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Allow the cache_detail to specify alternative upcall mechanismsTrond Myklebust2009-08-093-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For events that are rare, such as referral DNS lookups, it makes limited sense to have a daemon constantly listening for upcalls on a channel. An alternative in those cases might simply be to run the app that fills the cache using call_usermodehelper_exec() and friends. The following patch allows the cache_detail to specify alternative upcall mechanisms for these particular cases. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Remove the global temporary write buffer in net/sunrpc/cache.cTrond Myklebust2009-08-091-25/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we do want to protect against multiple concurrent readers and writers on each upcall/downcall pipe, we don't want to limit concurrent reading and writing to separate caches. This patch therefore replaces the static buffer 'write_buf', which can only be used by one writer at a time, with use of the page cache as the temporary buffer for downcalls. We still fall back to using the the old global buffer if the downcall is larger than PAGE_CACHE_SIZE, since this is apparently needed by the SPKM security context initialisation. It then replaces the use of the global 'queue_io_mutex' with the inode->i_mutex in cache_read() and cache_write(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Ensure we initialise the cache_detail before creating procfs filesTrond Myklebust2009-08-091-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also ensure that we destroy those files before we destroy the cache_detail. Otherwise, user processes might attempt to write into uninitialised caches. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | NFSD: Clean up the idmapper warning...Trond Myklebust2009-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | What part of 'internal use' is so hard to understand? Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: One more clean up for rpc_create_client_dir()Trond Myklebust2009-08-091-28/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to allow rpc_pipefs to create directories with different types of subtrees, it is useful to allow the caller to customise the subtree filling process. In order to do so, we separate out the parts which are specific to making an RPC client directory, and put them in a separate helper, then we convert the process of filling the directory contents into a callback. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: clean up rpc_setup_pipedir()Trond Myklebust2009-08-092-70/+36Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is still a little wart or two there: Since we've already got a vfsmount, we might as well pass that in to rpc_create_client_dir. Another point is that if we open code __rpc_lookup_path() here, then we can avoid looking up the entire parent directory path over and over again: it doesn't change. Also get rid of rpc_clnt->cl_pathname, since it has no users... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Replace rpc_client->cl_dentry and cl_mnt, with a cl_pathTrond Myklebust2009-08-092-14/+14
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up rpc_create_client_dir()Trond Myklebust2009-08-091-42/+41Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the code that does lookups from the code that actually creates the directory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Rename rpc_mkdir to rpc_create_client_dir()Trond Myklebust2009-08-092-9/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reflects the fact that rpc_mkdir() as it stands today, can only create a RPC client type directory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: rpc_pipefs cleanupTrond Myklebust2009-08-091-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | Move the files[] array closer to rpc_fill_super() Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up rpc_populate/depopulateTrond Myklebust2009-08-091-86/+101
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up rpc_lookup_createTrond Myklebust2009-08-091-41/+59
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up rpc_unlink()Trond Myklebust2009-08-091-8/+27
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up file creation code in rpc_pipefsTrond Myklebust2009-08-091-43/+77
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up rpc_pipefs lookup code...Trond Myklebust2009-08-091-5/+10
| | | | | | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Allow rpc_pipefs_ops to have null values for upcall and downcallTrond Myklebust2009-08-091-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | Also ensure that we use the umode_t type when appropriate... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Constify rpc_pipe_ops...Trond Myklebust2009-08-092-7/+8
| | |/ | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * | Merge branch 'patches_cel-for-2.6.32' into nfs-for-2.6.32Trond Myklebust2009-08-106-330/+784
| |\ \
| | * | SUNRPC: Add documenting comments in net/sunrpc/timer.cChuck Lever2009-08-091-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up: provide documenting comments for the functions in net/sunrpc/timer.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Update xprt address strings after an rpcbind completesChuck Lever2009-08-091-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a bind completes, update the transport instance's address strings so debugging messages display the current port the transport is connected to. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Kill RPC_DISPLAY_ALLChuck Lever2009-08-092-21/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At some point, I recall that rpc_pipe_fs used RPC_DISPLAY_ALL. Currently there are no uses of RPC_DISPLAY_ALL outside the transport modules themselves, so we can safely get rid of it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Rename sock_xprt.addr as sock_xprt.srcaddrChuck Lever2009-08-091-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up: Give the "addr" and "port" field less ambiguous names. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Eliminate PROC macro from rpcb_clntChuck Lever2009-08-091-22/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up: Replace PROC macro with open coded C99 structure initializers to improve readability. The rpcbind v4 GETVERSADDR procedure is never sent by the current implementation, so it is not copied to the new structures. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up: Remove unused XDR decoder functions from rpcb_clnt.cChuck Lever2009-08-091-81/+0Star
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Introduce new xdr_stream-based decoders to rpcb_clnt.cChuck Lever2009-08-091-3/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the open-coded decode logic for PMAP_GETPORT/RPCB_GETADDR with an xdr_stream-based implementation, similar to what NFSv4 uses, to protect against buffer overflows. The new implementation also checks that the incoming port number is reasonable. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Introduce xdr_stream-based decoders for RPCB_UNSETChuck Lever2009-08-091-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the open-coded decode logic for rpcbind UNSET results with an xdr_stream-based implementation, similar to what NFSv4 uses, to protect against buffer overflows. The new function is unused for the moment. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Clean up: Remove unused XDR encoder functions from rpcb_clnt.cChuck Lever2009-08-091-34/+0Star
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Introduce new xdr_stream-based encoders to rpcb_clnt.cChuck Lever2009-08-091-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the open-coded encode logic for rpcbind arguments with an xdr_stream-based implementation, similar to what NFSv4 uses, to better protect against buffer overflows. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Use rpc_ntop() for constructing transport address stringsChuck Lever2009-08-092-102/+52Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up: In addition to using the new generic rpc_ntop() and rpc_get_port() functions, have the RPC client compute the presentation address buffer sizes dynamically using kstrdup(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Remove duplicate universal address generationChuck Lever2009-08-093-45/+29Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RPC universal address generation is currently done in several places: rpcb_clnt.c, nfs4proc.c xprtsock.c, and xprtrdma.c. Remove the redundant cases that convert a socket address to a universal address. The nfs4proc.c case takes a pre-formatted presentation address string, not a socket address, so we'll leave that one. Because the new uaddr constructor uses the recently introduced rpc_ntop(), it now supports proper "::" shorthanding for IPv6 addresses. This allows the kernel to register properly formed universal addresses with the local rpcbind service, in _all_ cases. The kernel can now also send properly formed universal addresses in RPCB_GETADDR requests, and support link-local properly when encoding and decoding IPv6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Provide functions for managing universal addressesChuck Lever2009-08-092-1/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a set of functions in the kernel's RPC implementation for converting between a socket address and either a standard presentation address string or an RPC universal address. The universal address functions will be used to encode and decode RPCB_FOO and NFSv4 SETCLIENTID arguments. The other functions are part of a previous promise to deliver shared functions that can be used by upper-layer protocols to display and manipulate IP addresses. The kernel's current address printf formatters were designed specifically for kernel to user-space APIs that require a particular string format for socket addresses, thus are somewhat limited for the purposes of sunrpc.ko. The formatter for IPv6 addresses, %pI6, does not support short-handing or scope IDs. Also, these printf formatters are unique per address family, so a separate formatter string is required for printing AF_INET and AF_INET6 addresses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| | * | SUNRPC: Move XDR data type size macrosChuck Lever2009-08-091-25/+31
| | |/ | | | | | | | | | | | | | | | | | | | | | Clean up: To make subsequent patches cleaner, move the XDR data type size macros to the top of the file (similar to nfs4xdr.c) first. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| * / SUNRPC: convert some sysctls into module parametersTrond Myklebust2009-08-091-0/+52
| |/ | | | | | | | | | | | | Parameters like the minimum reserved port, and the number of slot entries should really be module parameters rather than sysctls. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* / SUNRPC: Fix rpc_task_force_reencodeTrond Myklebust2009-08-291-0/+1
|/ | | | | | | | | | | | | This patch fixes the bug that was reported in http://bugzilla.kernel.org/show_bug.cgi?id=14053 If we're in the case where we need to force a reencode and then resend of the RPC request, due to xprt_transmit failing with a networking error, then we _must_ retransmit the entire request. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* headers: smp_lock.h reduxAlexey Dobriyan2009-07-123-2/+1Star
| | | | | | | | | | | | | * Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* sunrpc: Use rcu_barrier() on unload.Jesper Dangaard Brouer2009-06-261-0/+1
| | | | | | | | | | | | | | | The sunrpc module uses rcu_call() thus it should use rcu_barrier() on module unload. Have not verified that the possibility for new call_rcu() callbacks has been disabled. As a hint for checking, the functions calling call_rcu() (unx_destroy_cred and generic_destroy_cred) are registered as crdestroy function pointer in struct rpc_credops. Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'for-2.6.31' of git://fieldses.org/git/linux-nfsdLinus Torvalds2009-06-224-60/+129
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-2.6.31' of git://fieldses.org/git/linux-nfsd: (60 commits) SUNRPC: Fix the TCP server's send buffer accounting nfsd41: Backchannel: minorversion support for the back channel nfsd41: Backchannel: cleanup nfs4.0 callback encode routines nfsd41: Remove ip address collision detection case nfsd: optimise the starting of zero threads when none are running. nfsd: don't take nfsd_mutex twice when setting number of threads. nfsd41: sanity check client drc maxreqs nfsd41: move channel attributes from nfsd4_session to a nfsd4_channel_attr struct NFS: kill off complicated macro 'PROC' sunrpc: potential memory leak in function rdma_read_xdr nfsd: minor nfsd_vfs_write cleanup nfsd: Pull write-gathering code out of nfsd_vfs_write nfsd: track last inode only in use_wgather case sunrpc: align cache_clean work's timer nfsd: Use write gathering only with NFSv2 NFSv4: kill off complicated macro 'PROC' NFSv4: do exact check about attribute specified knfsd: remove unreported filehandle stats counters knfsd: fix reply cache memory corruption knfsd: reply cache cleanups ...
| * SUNRPC: Fix the TCP server's send buffer accountingTrond Myklebust2009-06-191-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the sunrpc server is refusing to allow us to process new RPC calls if the TCP send buffer is 2/3 full, even if we do actually have enough free space to guarantee that we can send another request. The following patch fixes svc_tcp_has_wspace() so that we only stop processing requests if we know that the socket buffer cannot possibly fit another reply. It also fixes the tcp write_space() callback so that we only clear the SOCK_NOSPACE flag when the TCP send buffer is less than 2/3 full. This should ensure that the send window will grow as per the standard TCP socket code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
| * sunrpc: potential memory leak in function rdma_read_xdrChristian Engelmayer2009-06-161-4/+4
| | | | | | | | | | | | | | | | | | | | In case the check on ch_count fails the cleanup path is skipped and the previously allocated memory 'rpl_map', 'chl_map' is not freed. Reported by Coverity. Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>