aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2009-09-13nfsd41: sunrpc: add new xprt class for nfsv4.1 backchannelAlexandros Batsakis2-2/+95
[sunrpc: change idle timeout value for the backchannel] Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Acked-by: Trond Myklebust <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-09-11sunrpc/cache: simplify cache_fresh_locked and cache_fresh_unlocked.NeilBrown1-13/+10
The extra call to cache_revisit_request in cache_fresh_unlocked is not needed, as should have been fairly clear at the time of commit 4013edea9a0b6cdcb1fdf5d4011e47e068fd6efb If there are requests to be revisited, then we can be sure that CACHE_PENDING is set, so the second call is sufficient. So remove the first call. Then remove the 'new' parameter, then remove the return value for cache_fresh_locked which is only used to provide the value for 'new'. Signed-off-by: NeilBrown <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-09-11sunrpc/cache: change cache_defer_req to return -ve error, not boolean.NeilBrown1-5/+5
As "cache_defer_req" does not sound like a predicate, having it return a boolean value can be confusing. It is more consistent to return 0 for success and negative for error. Exactly what error code to return is not important as we don't differentiate between reasons why the request wasn't deferred, we only care about whether it was deferred or not. Signed-off-by: NeilBrown <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-09-11nfsd41: sunrpc: Added rpc server-side backchannel handlingRahul Iyer5-39/+300
When the call direction is a reply, copy the xid and call direction into the req->rq_private_buf.head[0].iov_base otherwise rpc_verify_header returns rpc_garbage. Signed-off-by: Rahul Iyer <[email protected]> Signed-off-by: Mike Sager <[email protected]> Signed-off-by: Marc Eshel <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [get rid of CONFIG_NFSD_V4_1] [sunrpc: refactoring of svc_tcp_recvfrom] [nfsd41: sunrpc: create common send routine for the fore and the back channels] [nfsd41: sunrpc: Use free_page() to free server backchannel pages] [nfsd41: sunrpc: Document server backchannel locking] [nfsd41: sunrpc: remove bc_connect_worker()] [nfsd41: sunrpc: Define xprt_server_backchannel()[ [nfsd41: sunrpc: remove bc_close and bc_init_auto_disconnect dummy functions] [nfsd41: sunrpc: eliminate unneeded switch statement in xs_setup_tcp()] [nfsd41: sunrpc: Don't auto close the server backchannel connection] [nfsd41: sunrpc: Remove unused functions] Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfsd41: change bc_sock to bc_xprt] [nfsd41: sunrpc: move struct rpc_buffer def into a common header file] [nfsd41: sunrpc: use rpc_sleep in bc_send_request so not to block on mutex] [removed cosmetic changes] Signed-off-by: Benny Halevy <[email protected]> [sunrpc: add new xprt class for nfsv4.1 backchannel] [sunrpc: v2.1 change handling of auto_close and init_auto_disconnect operations for the nfsv4.1 backchannel] Signed-off-by: Alexandros Batsakis <[email protected]> [reverted more cosmetic leftovers] [got rid of xprt_server_backchannel] [separated "nfsd41: sunrpc: add new xprt class for nfsv4.1 backchannel"] Signed-off-by: Benny Halevy <[email protected]> Cc: Trond Myklebust <[email protected]> [sunrpc: change idle timeout value for the backchannel] Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Acked-by: Trond Myklebust <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-09-10nfsd41: sunrpc: move struct rpc_buffer def into sunrpc.hBenny Halevy2-5/+12
Move struct rpc_buffer's definition into a sunrpc.h, a common, internal header file, in preparation for supporting the nfsv4.1 backchannel. Signed-off-by: Benny Halevy <[email protected]> [nfs41: sunrpc: #include <linux/net.h> from sunrpc.h] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-08-27sunrpc: move the close processing after do recvfrom methodWei Yongjun1-5/+7
sunrpc: "Move close processing to a single place" (d7979ae4a050a45b78af51832475001b68263d2a) moved the close processing before the recvfrom method. This may cause the close processing never to execute. So this patch moves it to the right place. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-08-25sunrpc: reply AUTH_BADCRED to RPCSEC_GSS with unknown serviceWei Yongjun1-2/+4
When an RPC message is received with RPCSEC_GSS with an unknown service (not RPC_GSS_SVC_NONE, RPC_GSS_SVC_INTEGRITY, or RPC_GSS_SVC_PRIVACY), svcauth_gss_accept() returns AUTH_BADCRED, but svcauth_gss_release() subsequently drops the response entirely, discarding the error. Fix that so the AUTH_BADCRED error is returned to the client. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-08-25knfsd: Replace lock_kernel with a mutex in nfsd pool stats.Ryusei Yamaguchi1-11/+0
lock_kernel() in knfsd was replaced with a mutex. The later commit 03cf6c9f49a8fea953d38648d016e3f46e814991 ("knfsd: add file to export stats about nfsd pools") did not follow that change. This patch fixes the issue. Also move the get and put of nfsd_serv to the open and close methods (instead of start and stop methods) to allow atomic check and increment of reference count in the open method (where we can still return an error). Signed-off-by: Ryusei Yamaguchi <[email protected]> Signed-off-by: Isaku Yamahata <[email protected]> Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Cc: Greg Banks <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-08-24nfsd41: sunrpc: svc_tcp_recv_record()Alexandros Batsakis1-28/+51
Factor functionality out of svc_tcp_recvfrom() to simplify routine Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2009-08-21Merge branch 'nfs-for-2.6.32' of ↵J. Bruce Fields94-1077/+2245
git://git.linux-nfs.org/projects/trondmy/nfs-2.6 into for-2.6.32-incoming Conflicts: net/sunrpc/cache.c
2009-08-21SUNRPC: Ensure that sunrpc gets initialised before nfs, lockd, etc...Trond Myklebust1-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 <[email protected]>
2009-08-19SUNRPC: cache must take a reference to the cache detail's module on open()Trond Myklebust1-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 <[email protected]>
2009-08-19NFS: Add a dns resolver for use with NFSv4 referrals and migrationTrond Myklebust1-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 <[email protected]>
2009-08-19SUNRPC: Fix a typo in cache_pipefs_filesTrond Myklebust1-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 <[email protected]>
2009-08-19Merge branch 'nfsv4_xdr_cleanups-for-2.6.32' into nfs-for-2.6.32Trond Myklebust2-7/+7
Conflicts: fs/nfs/nfs4xdr.c
2009-08-14sunrpc: ntoh -> be*_to_cpuBenny Halevy1-3/+3
ntohl is already defined as be32_to_cpu. be64_to_cpu has architecture specific optimized implementations. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-14sunrpc: hton -> cpu_to_be*Benny Halevy1-3/+3
htonl is already defined as cpu_to_be32. cpu_to_be64 has architecture specific optimized implementations. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-13Make sock_sendpage() use kernel_sendpage()Linus Torvalds1-1/+1
kernel_sendpage() does the proper default case handling for when the socket doesn't have a native sendpage implementation. Now, arguably this might be something that we could instead solve by just specifying that all protocols should do it themselves at the protocol level, but we really only care about the common protocols. Does anybody really care about sendpage on something like Appletalk? Not likely. Acked-by: David S. Miller <[email protected]> Acked-by: Julien TINNES <[email protected]> Acked-by: Tavis Ormandy <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
2009-08-10Merge branch 'sunrpc_cache-for-2.6.32' into nfs-for-2.6.32Trond Myklebust6-463/+858
2009-08-10Merge branch 'patches_cel-for-2.6.32' into nfs-for-2.6.32Trond Myklebust6-330/+784
2009-08-09SUNRPC: Add an rpc_pipefs front end for the sunrpc cache codeTrond Myklebust2-0/+169
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Move procfs-specific stuff out of the generic sunrpc cache codeTrond Myklebust1-129/+190
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Allow the cache_detail to specify alternative upcall mechanismsTrond Myklebust3-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 <[email protected]>
2009-08-09SUNRPC: Remove the global temporary write buffer in net/sunrpc/cache.cTrond Myklebust1-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 <[email protected]>
2009-08-09SUNRPC: Ensure we initialise the cache_detail before creating procfs filesTrond Myklebust1-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 <[email protected]>
2009-08-09NFSD: Clean up the idmapper warning...Trond Myklebust1-1/+1
What part of 'internal use' is so hard to understand? Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: One more clean up for rpc_create_client_dir()Trond Myklebust1-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 <[email protected]>
2009-08-09SUNRPC: clean up rpc_setup_pipedir()Trond Myklebust2-70/+36
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 <[email protected]>
2009-08-09SUNRPC: Replace rpc_client->cl_dentry and cl_mnt, with a cl_pathTrond Myklebust2-14/+14
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up rpc_create_client_dir()Trond Myklebust1-42/+41
Factor out the code that does lookups from the code that actually creates the directory. Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Rename rpc_mkdir to rpc_create_client_dir()Trond Myklebust2-9/+8
This reflects the fact that rpc_mkdir() as it stands today, can only create a RPC client type directory. Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: rpc_pipefs cleanupTrond Myklebust1-40/+40
Move the files[] array closer to rpc_fill_super() Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up rpc_populate/depopulateTrond Myklebust1-86/+101
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up rpc_lookup_createTrond Myklebust1-41/+59
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up rpc_unlink()Trond Myklebust1-8/+27
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up file creation code in rpc_pipefsTrond Myklebust1-43/+77
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up rpc_pipefs lookup code...Trond Myklebust1-5/+10
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Allow rpc_pipefs_ops to have null values for upcall and downcallTrond Myklebust1-4/+11
Also ensure that we use the umode_t type when appropriate... Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Constify rpc_pipe_ops...Trond Myklebust2-7/+8
Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Add documenting comments in net/sunrpc/timer.cChuck Lever1-16/+29
Clean up: provide documenting comments for the functions in net/sunrpc/timer.c. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Update xprt address strings after an rpcbind completesChuck Lever1-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Kill RPC_DISPLAY_ALLChuck Lever2-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Rename sock_xprt.addr as sock_xprt.srcaddrChuck Lever1-12/+12
Clean up: Give the "addr" and "port" field less ambiguous names. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Eliminate PROC macro from rpcb_clntChuck Lever1-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up: Remove unused XDR decoder functions from rpcb_clnt.cChuck Lever1-81/+0
Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Introduce new xdr_stream-based decoders to rpcb_clnt.cChuck Lever1-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Introduce xdr_stream-based decoders for RPCB_UNSETChuck Lever1-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Clean up: Remove unused XDR encoder functions from rpcb_clnt.cChuck Lever1-34/+0
Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Introduce new xdr_stream-based encoders to rpcb_clnt.cChuck Lever1-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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-08-09SUNRPC: Use rpc_ntop() for constructing transport address stringsChuck Lever2-102/+52
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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>