summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc
AgeCommit message (Collapse)Author
2003-05-12Add user pointer annotations to core filesystem routines.Linus Torvalds
2003-05-08Merge bk://linux.bkbits.net/linux-2.5Trond Myklebust
into hostme.bitkeeper.com:/ua/repos/n/nfsclient/linux-2.5
2003-05-07[PATCH] Work around include/linux/sunrpc/svc.h compilationAndrew Morton
From: Grzegorz Jaskiewicz <gj@pointblue.com.pl> gcc-2.94 fails to compile this code, alleging an invalid lvalue. An equivalent transformation fixes it up.
2003-05-07UDP and TCP zero copy code for the NFS client. The main interestTrond Myklebust
of this patch is to eliminate the use of xdr_kmap() and xdr_unmap() by replacing them with MSG_MORE. xdr_kmap() is deadlock-prone due to the fact that it has to kmap() several pages at the same time.
2003-05-07Ensure that Lockd and the NSM (statd) clients always use privilegedTrond Myklebust
ports. Remove the existing code to temporarily raise privileges in fs/lockd/host.c, and use the new code in net/sunrpc/xprt.c There should no longer be a need to temporarily change the fsuid. Remove this feature.
2003-03-14[PATCH] kNFSd: Assort fixes to nfsd auth cache stuff.Neil Brown
1/ call cache_fresh when replacing a cache entry (instead of only when updating) so that up-calls waiting on the replaced entry continue. 2/ in svcauth_unix_accept, don't put the verifier until all tests have succeeded. 3/ calculate size of request-being-deferred correctly.
2003-02-20[PATCH] try_module_get(THIS_MODULE) is bogusChristoph Hellwig
In most cases the fix is to add an struct module * member to the operations vector instead and manipulate the refcounts in the callers context. For the ALSA cases it was completly superflous (when will people get it that using an exported symbol will make it's module unloadable?..)
2003-02-17[PATCH] Keep track of which page is the 'tail' of an NFSd replyNeil Brown
NFS replies can have a 'tail' after a 'data' component (for read, readlink, readdir). For nfsv2 and v3 this tail is in the same page as the head. For nfsv4, this tail is in a separate page. We need to keep track of which page so that it right one gets sent. This patch does that.
2003-02-13[PATCH] further rpc_pipefs cleanups...Trond Myklebust
- Only set up pipefs entries for those RPC services that actually need them (for the moment NFS only). Portmap, lockd,... shouldn't need to make upcalls. - Add in missing semaphore in rpc_populate(). - Make inode/dentry variable names in rpc_depopulate/rpc_populate more consistent w.r.t other functions in rpc_pipe.c - Call shrink_dcache_parent() in order to clean up child entries before we rmdir().
2003-01-12[PATCH] minimal Kerberos V5 client support [6/6]Trond Myklebust
The following patch provides minimal client support for the (mandatory) Kerberos V5 authentication mechanism under RPCSEC_GSS. See RFC2623 and RFC3010 for protocol details. Only authentication is supported for the moment. Data integrity and/or data privacy (encryption) will be implemented at a later stage.
2003-01-12[PATCH] RPCSEC_GSS client upcall user [5/6]Trond Myklebust
This patches the RPCSEC_GSS client to make use of the upcall mechanism that was provided by patch [3/6]. If an RPC task presents a non-uptodate credential to call_refresh(), a user daemon is contacted by means of a dedicated rpc_pipefs pipe. The daemon is then fed the uid for which it must establish a new RPCSEC security context. While the daemon goes about its business, the RPC task is put to sleep on a wait queue in order to allow the 'rpciod' process to service other requests. If another task wants to use the same credential, it too will be put to sleep once it reaches call_refresh(). A timeout mechanism ensures that requests are retried (or that 'soft' mounts fail) if the daemon crashes / is killed. Once the daemon has established the RPCSEC context, it writes the result back to the pipe, causing the credential to be updated. Those RPC tasks that were sleeping on the context are automatically woken up, and their execution can proceed.
2003-01-12[PATCH] RPCSEC_GSS authentication framework [4/6]Trond Myklebust
This patch provides the basic framework for RPCSEC_GSS authentication in the RPC client. The protocol is fully described in RFC-2203. Sun has supported it in their commercial NFSv3 and v2 implementations for quite some time, and it has been specified in RFC3010 as being mandatory for NFSv4. - Update the mount_data struct for NFSv2 and v3 in order to allow them to pass an RPCSEC_GSS security flavour. Compatibility with existing versions of the 'mount' program is ensured by requiring that RPCSEC support be enabled using the new flag NFS_MOUNT_SECFLAVOUR. - Provide secure authentication, and later data encryption on a per-user basis. A later patch will an provide an implementation of the Kerberos 5 security mechanism. SPKM and LIPKEY are still being planned. - Security context negotiation and initialization are all assumed to be done in userland. A later patch will provide the actual upcall mechanisms to allow for this.
2003-01-12[PATCH] RPCSEC upcall mechanism [3/6]Trond Myklebust
This patch provides the upcall mechanism that will be used for communicating with the RPCSEC client user daemons. It sets up a 'ramfs' style filesystem (rpc_pipefs) that is populated with named pipes. Each time the kernel initializes a new NFS, lockd, statd or portmapper client, a directory automatically gets set up in this fs. The directory is initially only populated with a single file "info" that provides information such as the server IP address, the port number and the RPC service for the benefit of the user daemon. When an RPCSEC_GSS mechanism needs to communicate with the daemon, it is provided with a toolkit for setting up a named pipe in the same directory. It can then perform upcalls/downcalls in order to talk to the daemon in much the same way as is done by CODA. The NFSv4 client will also need to use this same filesystem to communicate with its user daemon in order to do name-to-uid/name-from-uid and name-to-gid/name-from-gid translation.
2003-01-12[PATCH] XDR 'encode' phase move [2/6]Trond Myklebust
The RPCSEC_GSS user context defines a 'sequence number' in the AUTH header fields in order to provide protection against replay attacks. This number needs to lie within a given 'window', and is required to be updated even when retransmitting dropped requests. In order to allow this update to occur, move the XDR 'encode' phase so that it is done immediately before writing the data to the socket.
2003-01-12[PATCH] Clean up RPC client credcache lookups [1/6]Trond Myklebust
Clean up RPC client credcache lookups. - Remove the limitation whereby the RPC client may only look up credentials for the current task. The ability to lookup arbitrary credentials is needed in order to allow a user daemon to set the RPCSEC_GSS private information once it has finished negotiating the RPCSEC user context with the server.
2003-01-10[PATCH] Change hash_mem to an inline function.Neil Brown
Implementing hash_str as hash_mem(..., strlen()) is actually quite slow, so create a separate hash_str. Now hash_mem has only one call site, and both are quite small, so we make them both inline.
2003-01-10[PATCH] Some tidyup of svc_authenticateNeil Brown
We encode that status in the return value. Also, don't pass 'proc' parameter to ->accept, as it is implicit in rqstp.
2003-01-10[PATCH] Tidy up closing of RPC server tcp connections to avoid racesNeil Brown
2003-01-07[PATCH] Cleanup for SunRPC auth codeTrond Myklebust
Converts the RPC client auth code to use 'list_head' rather than a custom pointer scheme. Fixes a (relatively harmless) race which could cause several cred entries to be created for the same user.
2003-01-05Merge davem@nuts.ninka.net:/home/davem/src/BK/sparc-2.5David S. Miller
into kernel.bkbits.net:/home/davem/sparc-2.5
2003-01-05[SUNRPC]: svcauth.h needs linux/string.hDavid S. Miller
2003-01-05Needs <linux/string.h> for strlen()Linus Torvalds
2003-01-05[PATCH] knfsd: Use hash_long from hash.h for hashing in rpc/svc caches.Neil Brown
It works much better than my little toy hash functions.
2003-01-05[PATCH] knfsd: Allow rpcsvc caches to provide a 'cache_show' methodNeil Brown
This provides a /proc/sunrpc/*/content seq_file for caches to display their content. This code is based on the code for /proc/fs/nfs/exports
2003-01-05[PATCH] knfsd: Fix bug in RPC cache when entry in replacedNeil Brown
2002-12-31Fix up numerous '`xxxxx' is not at beginning of declaration' style warnings.Dave Jones
2002-12-15[PATCH] Add helper routines for fixing up page alignment on xdr_bufTrond Myklebust
In order to speed up NFS reads, we attempt to copy directly from skbuffs into the pagecache pages. As we cannot do XDR decoding in the soft interrupts, we attempt to estimate the size of the RPC header (+ attributes,...) that will precede the actual data that goes in the pagecache. If we get the estimate wrong, the XDR decode routines perform a realignment of the data into the pagecache. In the existing code, we do a multi-page kmap() from the xdr_buf into an iovec array, in order to do the shift. The following patch adds tools for doing the realigment without going through the iovec array (and without having to do the deadlock-prone multi-page kmap()). It also adds the 2 helper routines xdr_read_pages()/xdr_write_pages() which will be needed for NFSv4 reads/writes in order to add pre/post operation GETATTR calls.
2002-12-05[PATCH] Linux PnP Support V0.93 - 2.5.50Adam Belay
Attached is a patch, that updates the 2.5.50 to the latest pnp version. It includes all 9 of the previously submitted patches. Highlights are as follows: -PnP BIOS fixes -Several new macros -PnP Card Services -Various bug fixes -more drivers converted to the new APIs
2002-11-21[PATCH] Split buffer overflow checking out of struct nfs4_compoundTrond Myklebust
Here is the a pre-patch in the attempt to get rid of 'struct nfs4_compound', and the associated horrible union in 'struct nfs4_op'. It splits out the fields that are meant to do buffer overflow checking and iovec adjusting on the XDR received/sent data. It moves support for that nto the dedicated structure 'xdr_stream', and the associated functions 'xdr_reserve_space()', 'xdr_inline_decode()'. The patch also expands out the all macros ENCODE_HEAD, ENCODE_TAIL, ADJUST_ARGS and DECODE_HEAD, as well as most of the DECODE_TAILs.
2002-11-16[PATCH] cleanup: switch to passing *(struct rpc_procinfo) in rpc_message.Trond Myklebust
The "procedure number" has been used for 2 purposes in the kernel client RPC implementation: 1) As a number to pass to the server in the RPC header. 2) As an index into the "procedure array" of type 'struct rpc_procinfo', from which the RPC layer can find the XDR encode/decode functions, buffer size, and all the other static data that it needs to construct the on-wire RPC message. This works fine for NFSv2, v3 and for the NLM locking code for which there is a one-to-one mapping between NFS file operations, and RPC procedures. For NFSv4 on the other hand, the mapping is many-to-one, since there is only one RPC procedure number: NFSPROC4_COMPOUND. For efficiency purposes, we want to have a one-to-one mapping between NFS file operations and the corresponding XDR encode/decode routines, but currently this is not possible because of (2). The result is the mess that is 'struct nfs4_op' and encode/decode_compound. In the process eliminating (2), we might as well change to passing a pointer to the appropriate procedure array entry instead of an index. This change can be made transparent The appended patch therefore does the following: - Substitute a pointer to the rpc_procinfo instead of the RPC procedure number in the struct rpc_message. - Make the RPC procedure number an entry in the struct rpc_procinfo. - Clean out the largely unused (except in some obscure lockd debugging code) p_name field. The latter was just a stringified version of the RPC procedure name, so for those lockd cases, we can use the RPC procedure number instead.
2002-11-08[PATCH] slabify the sunrpc layerTrond Myklebust
In order to better cope with low memory conditions, add slabs for struct rpc_task and 'small' RPC buffers of <= 2k. Protect these using mempools. The only case where we appear to use buffers of > 2k is when symlinking, and is due to the fact that the path can be up to 4k in length. For the moment, we just use kmalloc(), but it may be worth it some time in the near future to convert nfs_symlink() to use pages.
2002-11-08[PATCH] RTO estimator cleanup patchChuck Lever
clean up RPC client's RTO estimator.
2002-11-08[PATCH] fix jiffies wrap in new RPC RTO estimatorChuck Lever
the new RPC RTO estimator has some jiffies wrap problems.
2002-11-08[PATCH] use C99 static struct initializersChuck Lever
fix up the last remaining static struct initializers in the RPC client and portmapper.
2002-11-08[PATCH] remove unused RPC cruftChuck Lever
smaller patch that removes unused RPC cruft.
2002-11-08[PATCH] remove unused cl_flags fieldChuck Lever
The RPC clnt struct has a cl_flags field with one bit defined (in an NFS header, no less). no one ever sets the flag, so remove flag, field, and test in NFSv2 XDR routines that check for the flag.
2002-11-06[PATCH] kNFSd: Make sure final xdr_buf.len is correct on server replyNeil Brown
rq_res->len was not always updated properly. It is only needed in the sendto routine, so we calculate it just before that is called, and don't bother updating it anywhere else.
2002-11-06[PATCH] kNFSd: Support zero-copy read for NFSDNeil Brown
From Hirokazu Takahashi <taka@valinux.co.jp> This patch changes read and readdir in nfsd. read: If the file supports readpage, we use it to collect pages out of the page cache and to attache them directly to the outgoing nfs reply. The reduces the number of copies by one, and if the filesystem/device driver didn't copy the data, and if the network card can support not copying the data, then you get zero-copy reads. readdir: A separate page is used for stoing the readdir response so that a fill PAGE_SIZE bytes of reply can be supported.
2002-11-06[PATCH] kNFSd: Use ->sendpage to send nfsd (and lockd) replies.Neil Brown
From Hirokazu Takahashi <taka@valinux.co.jp> As all rpc server replies are now in well defined pages, we can use ->sendpage to send these replies, and so make use for zero-copy transmit on network cards that support it.
2002-10-30[PATCH] kNFSd: Convert nfsd to use a list of pages instead of one big bufferNeil Brown
This means: 1/ We don't need an order-4 allocation for each nfsd that starts 2/ We don't need an order-4 allocation in skb_linearize when we receive a 32K write request 3/ It will be easier to incorporate the zero-copy read changes The pages are handed around using an xdr_buf (instead of svc_buf) much like the NFS client so future crypto code can use the same data structure for both client and server. The code assumes that most requests and replies fit in a single page. The exceptions are assumed to have some largish 'data' bit, and the rest must fit in a single page. The 'data' bits are file data, readdir data, and symlinks. There must be only one 'data' bit per request. This is all fine for nfs/nlm. This isn't complete: 1/ NFSv4 hasn't been converted yet (it won't compile) 2/ NFSv3 allows symlinks upto 4096, but the code will only support upto about 3800 at the moment 3/ readdir responses are limited to about 3800. but I thought that patch was big enough, and the rest can come later. This patch introduces vfs_readv and vfs_writev as parallels to vfs_read and vfs_write. This means there is a fair bit of duplication in read_write.c that should probably be tidied up...
2002-10-15[PATCH] kNFSd: Change names of some exported functionsNeil Brown
... as generic names probably aren't such a good idea. Also sort the related EXPORT_SYMBOLS. A 'qword' is a 'quoted word' and can be added, added as hex, or got (getted??).
2002-10-15[PATCH] kNFSd: Reorganise rpc program version management.Neil Brown
An rpc service like NFSD knows about a number of versions (2,3,4) and needs to know the max and min valid version numbers, and also the maximum xdr buffer size used by any version. These max/mins are currently computed at compile time which means we need to include all the xdr*.h headers into nfssvc.c just for computing a couple of numbers. With this patch, these max/mins are calculated at run time from information in the svc_version structure which has been extended to include per-version xdrsize. Also the nfsd_version2, nfsd_version3, and nfsd_version4 structures are moved from nfssvc.c to their more correct home of nfs*proc.c Code gets neated, xdr*.h are no-longer included in nfssvc.c, and the ugly ifdef can be removed fom xdr4.h
2002-10-11[PATCH] kNFSd: get_int and get_expiry to help in parsing.Neil Brown
2002-10-11[PATCH] kNFSd: Implement get_word to help in parsing cache updatesNeil Brown
get_word understands both \x and \012 quoting styles.
2002-10-11[PATCH] kNFSd: Provide generic code for making an upcall.Neil Brown
This code enhances 'cache_check' to try to initiate an up-call if the cache entry is not up-to-date, and also defines add_word and add_hex for formating up-call requests. See rpc-cache.txt for more detail.
2002-10-11[PATCH] kNFSd: Create files: /proc/net/rpc/$CACHENAME/channel for ↵Neil Brown
communicating cache updates with kernel Each cache gets it's own 'channel' at /proc/net/rpc/$CACHENAME/channel Reads from the file will return all pending requests, one at a time. select will block when at end of file. writes will pass full lines in to be processed.
2002-10-11[PATCH] kNFSd: Provide support for request deferral and revisit.Neil Brown
cache.c gets code to allow a 'request' to be referred pending an update of a cache item, and revisited when the item is updates. svcsock.c gets code to store the relevant part of a request on deferral, and to re-queue it when the cache item that caused the deferral is filled in.
2002-10-11[PATCH] kNFSd: Move auth domain lookup into svcauthNeil Brown
Instead of doing the lookup from ipaddr to domain inside the nfs server, (and also when lockd calls into nfsd) it is now done at the rpc authentication level which is a more sensible place for it. Note that both AUTH_UNIX and AUTH_NULL do the same lookup. So that the rpc layer knows that nfsd and lockd both uses the name space of domains (while other hypothetical services may not) we introduce a 'class' for each service which svc_auth combines with the IP address when doing a lookup.
2002-10-11[PATCH] kNFSd: Use new cache infrastructure for auth_unix specific lookups.Neil Brown
This patch introduces two caches using the new infrastucture, and the concept of a 'domain'. A 'domain' refers to a collection of clients that all have the same view of the nfs server, and all have the same access rights (modulo different users on the clients). For AUTH_UNIX (and AUTH_NULL), the domain is determined from the IP address. For other authentication styles, the domain might be determined directly from the credentials. Each auth flavour knows how to allocate and free it's domain-specific infomation. auth_domain_cache maps a name to a domain which is owned by an auth flavour. ip_map_cache is a cache specific to AUTH_UNIX which maps IP address to domain. With this patch, svcauth_unix.c is created to store all auth_unix related code. The IP address lookup code is removed from nfsd/exports.c sunrpc module initilisation is moved out of stats.c into sunrpc_syms which seemed to be the most central .c file. It now registers these two caches. Now that the caches are being used, nfsd needs to call cache_clean periodically.
2002-10-11[PATCH] kNFSd: Initialial caching infrastructure for RPC authentication cachesNeil Brown
This patch provides a "virtual class" for defining caches that make user-space information available in the kernel It is intended for RPC services or clients that need user-space support for authentication. As yet, support for userspace interaction isn't included as I want that to be able to have separate review.