Experimental NFS client patches for Linux 2.4.19

Please note: the patches in this directory represent what I am currently using on my machine. They are experimental, and are made available only so that people can test out features that I plan for inclusion in the kernel in the future.

A brief explanation of the patches in this directory

linux-2.4.19-00-fix_clnt.dif:

Fix NFS locking bug

The code in question in supposed to ensure that we don't wait on a reply if the RPC call doesn't expect one. However, if the socket transmission failed for some reason, we do actually want to loop and try again... This bug will hit the RPC call in nlmsvc_grant_blocked().

linux-2.4.19-01-fix_kmap1.dif:

Teach RPC client to send pages rather than iovecs.

Stop rpciod from deadlocking against itself in map_new_virtual() on HIGHMEM systems. RPC client currently has to keep all pages that are scheduled for transmission kmap()ed into an iovec for the entire duration of the call. We only actually need to kmap() pages while making the (non-blocking) call to sock_sendmsg().

NOTE: When transmitting several pages in one RPC call, sock_sendmsg() requires us to kmap() *all* those pages at the same time. Opens for deadlocks between rpciod and some other process that also kmaps more than 1 page at a time. For the TCP case we can solve later by converting to TCP_CORK+sendpage().

linux-2.4.19-02-fix_kmap2.dif:

RPC client receive deadlock removal on HIGHMEM systems

Remove another class of rpciod deadlocks on HIGHMEM systems. Kick habit of keeping pages kmap()ed for the entire duration of NFS read/readdir/readlink operations.

Use struct page directly in RPC client data receive buffer. TCP and UDP sk->data_ready() bottom-halves copy (and checksum when needed) data into pages rather than iovecs. atomic_kmap() of single pages is used for the copy.

linux-2.4.19-03-fix_kmap3.dif:

Clean out routines that were obsoleted by previous

Remove obsolete NFS and RPC routines. Remove 'inline' attribute from xdr_decode_fattr().

linux-2.4.19-04-rpc_rep1.dif:

Clean up RPC receive code

Divorces task xid<->request slot mapping from the internals of the rpc_waitqueue xprt->pending. Instead xprt_lookup_rqst() is made to search a dedicated list (xprt->recv) on which the request slot is placed immediately after being allocated to a task. The new queue is protected using the spinlock xprt->sock_lock rather than the generic RPC task lock.

Both udp_data_ready() and tcp_data_ready() (well tcp_read_request() actually) now need to protect against the request being removed from the xprt->recv list while they copy the RPC reply data from the skb. On the other hand, they no longer need to worry about the task disappearing from xprt->pending. This means that rpc_lock_task() hack can be replaced by the spinlock xprt->sock_lock.

linux-2.4.19-05-rpc_rep2.dif:

Clean out some code that has been obsoleted by the above patches.

linux-2.4.19-06-rpc_rtt1.dif:

Implements a basic round trip timing algorithm in order to improve UDP timeout performance. See the description in Van Jacobson's paper 1998 paper "Congestion Avoidance and Control"

linux-2.4.19-07-rpc_rtt2.dif:

Implement a counter that tells us how many requests have currently timed out.

linux-2.4.19-08-rpc_rtt3.dif:

Improve the response to timeouts. As requests time out, we delay timing out the remaining requests (in fact we use an exponential backoff). This is done because we assume either that the round trip time has been underestimated, or that the network/server is congested, and we need to back off the resending of new requests.

linux-2.4.19-09-xprt_write.dif:

Cleanups for the socket locking mechanism.

linux-2.4.19-10-rpc_cong1.dif:

Clean up the RPC over UDP network congestion control code.

linux-2.4.19-11-rpc_cong2.dif:

Stricter enforcement of the UDP congestion avoidance algorithm as detailed in Van Jacobson's 1998 paper "Congestion Avoidance and Control"

linux-2.4.19-12-rpc_cong3.dif:

When determining who gets access to the socket, give priority to requests that are being resent.

linux-2.4.19-13-rpc_wspace.dif:

Clean up the RPC "write_space" socket congestion avoidance code.

linux-2.4.19-14-call_start.dif:

A patch by Chuck Lever that fixes an accounting error in the 'rpc' field in /proc/net/rpc/nfs.

linux-2.4.19-15-call_reserve1.dif:

A patch by Chuck Lever that cleans up the RPC socket slot allocation code.

linux-2.4.19-16-call_reserve2.dif:

A patch by Chuck Lever with further cleanups of the RPC socket slot allocation code.

linux-2.4.19-17-rpcbuf.dif:

Make RPC over UDP use a socket buffer size that is large enough to fit all the messages. Congestion control is in any case handled by the Van Jacobson algoritm, and we need to work around a bug in ip_build_xmit_slow() w.r.t. fragmentation when there is insufficient buffer memory to fit the entire message.

linux-2.4.19-RPC_ALL.dif:

A patch containing all of the above changes to the RPC code. As it is a collection of experimental patches, please expect it to change without notice.

linux-2.4.19-18-noac.dif:

Another patch by Chuck Lever that ensures that the PG_uptodate bit gets set when the entire page gets written by nfs_writepage_sync().

linux-2.4.19-19-seekdir.dif:

A patch that papers over a glibc bug. In glibc-2.2 and above, they use the new getdents64() syscall even for the 32-bit readdir. As a result, they have problems coping with the unsigned 64-bit d_off values that may get returned by some NFSv3 servers.

If you are seeing problems involving files that mysteriously disappear from your directory listings, then please consider applying this patch.

NOTE: You might still have to set the '32bitclients' export option on some IRIX servers.

NOTE: This patch assumes that you've applied most of the patches from linux-2.4.19-RPC_ALL.dif. If you prefer not to apply these patches, please use linux-2.4.18-seekdir.dif instead.

linux-2.4.19-20-cto2.dif:

Reduce the number of getattr/lookup calls in nfs_lookup_revalidate() by making the latter rely on the ordinary attribute cache, and moving the close-to-open data consistency checking into nfs_open().

This does mean that we can end up calling GETATTR twice: once in nfs_lookup_revalidate() then immediately after in nfs_open(), however it also means that sys_stat() and friends now use cached attributes.

linux-2.4.19-21-access.dif:

Implements full support for the NFSv3 ACCESS function. This means that file permission mapping, ACLs, and uid/gid mapping on the server should work as expected, allowing or denying certain types of behaviour.

Note that ACCESS results are cached in order to improve performance. The caching period is the same as that used to cache attributes (so if you use 'noac', you can expect a nasty performance hit).

linux-2.4.19-22-rdplus.dif:

Implements the NFSv3 READDIRPLUS function that allows further file lookup caching improvements.

linux-2.4.19-23-pathconf.dif:

A patch that ensures we don't exceed the maximum file name length on an NFSv3 partition.

linux-2.4.19-24-odirect.dif:

A patch by Chuck Lever that implements experimental support for direct I/O over NFS. See the Configure.help file for further info.

Note: you should really consider applying linux-2.4.19-23-pathconf.dif together with this patch. This will allow you to align your O_DIRECT writes on the server's hardware block boundaries rather than being forced to align on the NFS client block boundaries.

linux-2.4.19-25-fsync_dir.dif:

Make fsync() return '0' instead of -EINVAL when applied to directories. This fixes a problem with recent versions of the 'exim' program.

linux-2.4.19-26-fix_lockd1.dif:

A patch by Patrice Dumas to implement nlmsvc_proc_granted_res. When a server receives that callback it deallocates the corresponding block, using the nlmsvc_grant_reply function.

linux-2.4.19-27-fix_lockd2.dif:

A patch by Patrice Dumas to add a check in order to ensure that we really were requesting a blocking lock when we get a reply from the server asking us to block.

linux-2.4.19-28-fix_lockd3.dif:

A patch by Patrice Dumas that ensures that the server index blocks uniquely by using the client address in addition to the value of the NLM cookie field.

linux-2.4.19-29-fix_lockd4.dif:

A patch to ensures that blocks which are not going to time out are places last on the nlm_block list (problem reported by Olaf Kirch).

linux-2.4.19-NFS_ALL.dif:

A patch containing all of the above changes to the NFS and RPC code. As it is a collection of experimental patches, please expect it to change without notice.

linux-2.4.19-30-neilb.dif:

A subset of knfsd maintainer Neil Brown's NFS server patches that provide the server side support for NFS over TCP as per the latest 2.5.x kernels. The original patches from Neil's site have been doctored a bit so as not to conflict with the NFS_ALL patch.

Patches that have been included in this subset: patch-Y-RpcLists, patch-Z-RpcInit, patch-a-RpcSvcLocking, patch-b-RpcTcpCloseBad, patch-c-RpcTcpCloseIdle, patch-d-RpcTcpReserve, patch-e-NfsdRespSize, patch-f-RpcSvcTcpLimit, patch-g-NfsdTcpEnable, and patch-h-NfsdMaxBlkSize.

Please see Neil's site for an explanation of what these patches do and/or for more recent versions.


Return to main menu

Please address all comments about this page to Trond Myklebust
About Trond
Last modified: Thu Aug 1 12:57:27 CEST 2002
[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[DIR]old/ 2005-03-11 22:55 -  
[TXT]linux-2.4.18-seekdir..>2001-08-15 12:19 3.2K 
[TXT]linux-2.4.19-00-fix_..>2002-07-23 15:04 510  
[TXT]linux-2.4.19-01-fix_..>2002-11-01 17:33 18K 
[TXT]linux-2.4.19-02-fix_..>2002-07-31 21:03 44K 
[TXT]linux-2.4.19-03-fix_..>2002-10-05 01:46 6.4K 
[TXT]linux-2.4.19-04-rpc_..>2002-08-01 09:50 8.4K 
[TXT]linux-2.4.19-05-rpc_..>2002-07-23 21:16 4.4K 
[TXT]linux-2.4.19-06-rpc_..>2002-08-01 10:12 15K 
[TXT]linux-2.4.19-07-rpc_..>2002-08-01 10:13 2.7K 
[TXT]linux-2.4.19-08-rpc_..>2002-08-01 10:14 2.4K 
[TXT]linux-2.4.19-09-xprt..>2002-08-01 10:15 3.2K 
[TXT]linux-2.4.19-10-rpc_..>2002-08-01 10:17 4.2K 
[TXT]linux-2.4.19-11-rpc_..>2002-10-05 00:11 5.7K 
[TXT]linux-2.4.19-12-rpc_..>2002-10-05 00:11 2.2K 
[TXT]linux-2.4.19-13-rpc_..>2002-08-01 10:20 3.5K 
[TXT]linux-2.4.19-14-call..>2002-07-27 13:37 2.6K 
[TXT]linux-2.4.19-15-call..>2002-07-27 13:39 2.0K 
[TXT]linux-2.4.19-16-call..>2002-08-01 09:56 7.5K 
[TXT]linux-2.4.19-17-rpcb..>2002-08-01 10:25 4.0K 
[TXT]linux-2.4.19-18-noac..>2002-07-25 15:57 809  
[TXT]linux-2.4.19-19-seek..>2002-07-25 16:00 3.2K 
[TXT]linux-2.4.19-20-cto2..>2002-08-01 09:57 2.0K 
[TXT]linux-2.4.19-21-acce..>2002-08-01 10:30 5.7K 
[TXT]linux-2.4.19-22-rdpl..>2002-10-05 01:32 15K 
[TXT]linux-2.4.19-23-path..>2002-08-01 10:31 16K 
[TXT]linux-2.4.19-24-odir..>2002-07-08 22:19 19K 
[TXT]linux-2.4.19-25-fsyn..>2002-07-09 13:52 1.1K 
[TXT]linux-2.4.19-26-fix_..>2002-07-23 16:13 3.4K 
[TXT]linux-2.4.19-27-fix_..>2002-07-23 16:13 524  
[TXT]linux-2.4.19-28-fix_..>2002-07-23 16:13 4.1K 
[TXT]linux-2.4.19-29-fix_..>2002-07-23 16:14 545  
[TXT]linux-2.4.19-30-neil..>2002-08-01 10:37 61K 
[TXT]linux-2.4.19-NFS_ALL..>2002-11-01 17:36 169K 
[TXT]linux-2.4.19-RPC_ALL..>2002-11-01 17:36 108K 

Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16 mod_perl/2.0.11 Perl/v5.16.3 Server at linux-nfs.org Port 80