NFS client patches for Linux 2.6.25

The following set of patches fix known issues with the 2.6.25 NFS client code, and significantly enhance the support for NFSv4.

linux-2.6.25-001-fix_call_decode.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Sat, 19 Apr 2008 13:15:47 -0400

SUNRPC: Fix a bug in call_decode()

call_verify() can, under certain circumstances, free the RPC slot. In that case, our cached pointer 'req = task->tk_rqstp' is invalid. Bug was introduced in commit 220bcc2afd7011b3e0569fc178331fa983c92c1b (SUNRPC: Don't call xprt_release in call refresh).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-002-fix_race_in_xprt_write_space.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Thu, 17 Apr 2008 18:52:19 -0400

SUNRPC: Fix up xprt_write_space()

The rest of the networking layer uses SOCK_ASYNC_NOSPACE to signal whether or not we have someone waiting for buffer memory. Convert the SUNRPC layer to use the same idiom. Remove the unlikely()s in xs_udp_write_space and xs_tcp_write_space. In fact, the most common case will be that there is nobody waiting for buffer space.

SOCK_NOSPACE is there to tell the TCP layer whether or not the cwnd was limited by the application window. Ensure that we follow the same idiom as the rest of the networking layer here too.

Finally, ensure that we clear SOCK_ASYNC_NOSPACE once we wake up, so that write_space() doesn't keep waking things up on xprt->pending.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-003-dont_destroy_expired_gss_creds.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Sat, 19 Apr 2008 14:22:31 -0400

SUNRPC: Don't attempt to destroy expired RPCSEC_GSS credentials..

..and always destroy using a 'soft' RPC call. Destroying GSS credentials isn't mandatory; the server can always cope with a few credentials not getting destroyed in a timely fashion.

This actually fixes a hang situation. Basically, some servers will decide that the client is crazy if it tries to destroy an RPC context for which they have sent an RPCSEC_GSS_CREDPROBLEM, and so will refuse to talk to it for a while. The regression therefor probably was introduced by commit 0df7fb74fbb709591301871a38aac7735a1d6583.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-004-fix_nfs_wb_page.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 11 Apr 2008 16:03:54 -0400

NFS: Fix nfs_wb_page() to always exit with an error or a clean page

It is possible for nfs_wb_page() to sometimes exit with 0 return value, yet the page is left in a dirty state. For instance in the case where the server rebooted, and the COMMIT request failed, then all the previously "clean" pages which were cached by the server, but were not guaranteed to have been writted out to disk, have to be redirtied and resent to the server. The fix is to have nfs_wb_page_priority() check that the page is clean before it exits...

This fixes a condition that triggers the BUG_ON(PagePrivate(page)) in nfs_create_request() when we're in the nfs_readpage() path.

Also eliminate a redundant BUG_ON(!PageLocked(page)) while we're at it. It turns out that clear_page_dirty_for_io() has the exact same test.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-005-ensure_read_unlocks_on_rpc_run_task_failure.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Apr 2008 16:33:58 -0400

NFS: Ensure that the read code cleans up properly when rpc_run_task() fails

In the case of readpage() we need to ensure that the pages get unlocked, and that the error is flagged.

In the case of O_DIRECT, we need to ensure that the pages are all released.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-006-ensure_write_handles_rpc_run_task_failure.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Apr 2008 16:56:39 -0400

NFS: Ensure that the write code cleans up properly when rpc_run_task() fails

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-007-read_write_propagate_rpc_run_task_errors.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Mon, 14 Apr 2008 14:54:53 -0400

NFS: Ensure that rpc_run_task() errors are propagated back to the caller

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-008-remove_bogus_nfs4_drop_state_owner.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Sat, 5 Apr 2008 15:54:17 -0400

NFSv4: Remove bogus call to nfs4_drop_state_owner() in _nfs4_open_expired()

There should be no need to invalidate a perfectly good state owner just because of a stale filehandle. Doing so can cause the state recovery code to break, since nfs4_get_renew_cred() and nfs4_get_setclientid_cred() rely on finding active state owners.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-009-fix_up_seqid_increment.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Mon, 7 Apr 2008 13:20:54 -0400

NFSv4: Only increment the sequence id if the server saw it

It is quite possible that the OPEN, CLOSE, LOCK, LOCKU,... compounds fail before the actual stateful operation has been executed (for instance in the PUTFH call). There is no way to tell from the overall status result which operations were executed from the COMPOUND.

The fix is to move incrementing of the sequence id into the XDR layer, so that we do it as we process the results from the stateful operation.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-010-fix_warn_on.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 21 Mar 2008 16:19:41 -0400

SUNRPC: Fix read ordering problems with req->rq_private_buf.len

We want to ensure that req->rq_private_buf.len is updated before req->rq_received, so that call_decode() doesn't use an old value for req->rq_rcv_buf.len.

In 'call_decode()' itself, instead of using task->tk_status (which is set using req->rq_received) must use the actual value of req->rq_private_buf.len when deciding whether or not the received RPC reply is too short.

Finally ensure that we set req->rq_rcv_buf.len to zero when retrying a request. A typo meant that we were resetting req->rq_private_buf.len in call_decode(), and then clobbering that value with the old rq_rcv_buf.len again in xprt_transmit().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-011-fix_fl_flags_nlm.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 1 Apr 2008 18:57:06 -0400

NLM/lockd: Ensure we don't corrupt fl->fl_flags in nlmclnt_unlock()

Also fix up nlmclnt_lock() so that it doesn't pass modified versions of fl->fl_flags to nlmclnt_cancel() and other helpers.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-012-fix_fl_flags_nfs4.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 4 Apr 2008 15:08:02 -0400

NFSv4: Ensure we don't corrupt fl->fl_flags in nfs4_proc_unlck

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-013-reference_count_nlm_rqst.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 1 Apr 2008 18:58:49 -0400

NLM/lockd: Add a reference counter to struct nlm_rqst

When we replace the existing synchronous RPC calls with asynchronous calls, the reference count will be needed in order to allow us to examine the result of the RPC call.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-014-convert_nlm_async_call.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 28 Mar 2008 16:04:36 -0400

NLM/lockd: convert __nlm_async_call to use rpc_run_task()

Peter Staubach comments:

> In the course of investigating testing failures in the locking phase of > the Connectathon testsuite, I discovered a couple of things. One was > that one of the tests in the locking tests was racy when it didn't seem > to need to be and two, that the NFS client asynchronously releases locks > when a process is exiting. ... > The Single UNIX Specification Version 3 specifies that: "All locks > associated with a file for a given process shall be removed when a file > descriptor for that file is closed by that process or the process holding > that file descriptor terminates.". > > This does not specify whether those locks must be released prior to the > completion of the exit processing for the process or not. However, > general assumptions seem to be that those locks will be released. This > leads to more deterministic behavior under normal circumstances.

The following patch converts the NFSv2/v3 locking code to use the same mechanism as NFSv4 for sending asynchronous RPC calls and then waiting for them to complete. This ensures that the UNLOCK and CANCEL RPC calls will complete even if the user interrupts the call, yet satisfies the above request for synchronous behaviour on process exit.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-015-remove_unnecessary_signal_masking.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 28 Mar 2008 16:04:51 -0400

NLM: Remove the signal masking in nlmclnt_proc/nlmclnt_cancel

The signal masks have been rendered obsolete by the preceding patch.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-016-make_nlmclnt_cancel_return_status_info.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Wed, 2 Apr 2008 14:40:53 -0400

NLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call

Currently, it returns success as long as the RPC call was sent. We'd like to know if the CANCEL operation succeeded on the server.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-017-fix_nlmclnt_cancel_race.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 1 Apr 2008 20:26:22 -0400

NLM/lockd: Fix a race when cancelling a blocking lock

We shouldn't remove the lock from the list of blocked locks until the CANCEL call has completed since we may be racing with a GRANTED callback.

Also ensure that we send an UNLOCK if the CANCEL request failed. Normally that should only happen if the process gets hit with a fatal signal.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-018-remove_buggy_lock_on_signal.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 1 Apr 2008 20:26:52 -0400

NFS: Remove the buggy lock-if-signalled case from do_setlk()

Both NLM and NFSv4 should be able to clean up adequately in the case where the user interrupts the RPC call...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-019-nlm_client_use_correct_credentials.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Wed, 2 Apr 2008 14:44:05 -0400

NLM/lockd: Ensure client locking calls use correct credentials

Now that we've added the 'generic' credentials (that are independent of the rpc_client) to the nfs_open_context, we can use those in the NLM client to ensure that the lock/unlock requests are authenticated to whoever originally opened the file.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-020-cleanup_nfs_stat_to_errno.dif:

From: Benny Halevy <bhalevy@panasas.com>

Date: Mon, 31 Mar 2008 17:39:06 +0300

nfs: return negative error value from nfs{,4}_stat_to_errno

All use sites for nfs{,4}_stat_to_errno negate their return value. It's more efficient to return a negative error from the stat_to_errno convertors rather than negating its return value everywhere. This also produces slightly smaller code.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-021-zero_pad_hex_bitfields.dif:

From: Fred Isaman <iisaman@citi.umich.edu>

Date: Wed, 2 Apr 2008 15:21:15 +0300

nfs: fix printout of multiword bitfields

Benny points out that zero-padding of multiword bitfields is necessary, and that delimiting each word is nice to avoid endianess confusion.

bhalevy: without zero padding output can be ambiguous. Also, since the printed array of two 32-bit unsigned integers is not a 64-bit number, delimiting the output with a semicolon makes more sense.

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>

Signed-off-by: Benny Halevy <bhalevy@panasas.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-022-fixup_setclientid_cred_cr_name.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Mon, 7 Apr 2008 20:49:28 -0400

NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid()

With the recent change to generic creds, we can no longer use cred->cr_ops->cr_name to distinguish between RPCSEC_GSS principals and AUTH_SYS/AUTH_NULL identities. Replace it with the rpc_authops->au_name instead...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-023-reintroduce_machine_creds.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Mon, 7 Apr 2008 20:50:11 -0400

NFSv4: Reintroduce machine creds

We need to try to ensure that we always use the same credentials whenever we re-establish the clientid on the server. If not, the server won't recognise that we're the same client, and so may not allow us to recover state.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-024-use_machine_creds.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 8 Apr 2008 16:02:17 -0400

NFSv4: Attempt to use machine credentials in SETCLIENTID calls

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-025-delay_cred_expiry.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Mon, 14 Apr 2008 18:13:37 -0400

SUNRPC: Protect creds against early garbage collection

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-026-remove_XS_SENDMSG_RETRY.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Wed, 16 Apr 2008 16:51:38 -0400

SUNRPC: remove XS_SENDMSG_RETRY

The condition for exiting from the loop in xs_tcp_send_request() should be that we find we're not making progress (i.e. number of bytes sent is 0).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-027-remove_export_xprt_force_disconnect.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Thu, 17 Apr 2008 14:00:47 -0400

SUNRPC: Remove the unused export of xprt_force_disconnect

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-028-add_connection_cookie.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Thu, 17 Apr 2008 16:52:57 -0400

SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests

NFSv4 requires us to ensure that we break the TCP connection before we're allowed to retransmit a request. However in the case where we're retransmitting several requests that have been sent on the same connection, we need to ensure that we don't interfere with the attempt to reconnect and/or break the connection again once it has been established.

We therefore introduce a 'connection' cookie that is bumped every time a connection is broken. This allows requests to track if they need to force a disconnection.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-029-fix_race_in_gss_refresh_upcall.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Thu, 17 Apr 2008 16:53:01 -0400

SUNRPC: Fix a race in gss_refresh_upcall()

If the downcall completes before we get the spin_lock then we currently fail to refresh the credential.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-030-fix_gss_refresh.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Thu, 17 Apr 2008 17:03:58 -0400

SUNRPC: Don't change the RPCSEC_GSS context on a credential that is in use

When a server rejects our credential with an AUTH_REJECTEDCRED or similar, we need to refresh the credential and then retry the request. However, we do want to allow any requests that are in flight to finish executing, so that we can at least attempt to process the replies that depend on this instance of the credential.

The solution is to ensure that gss_refresh() looks up an entirely new RPCSEC_GSS credential instead of attempting to create a context for the existing invalid credential.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-031-fix_null_pointer_def_in_validate_mount_data.dif:

From: Cyrill Gorcunov <gorcunov@gmail.com>

Date: Thu, 17 Apr 2008 20:42:09 +0400

NFS - fix potential NULL pointer dereference v2

There is possible NULL pointer dereference if kstr[n]dup failed. So fix them for safety.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-032-remove_duplicate_flags_assignment.dif:

From: Jeff Layton <jlayton@redhat.com>

Date: Fri, 11 Apr 2008 11:50:58 -0400

NFS: remove duplicate flags assignment from nfs_validate_mount_data

Signed-off-by: Jeff Layton <jlayton@redhat.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-033-make_nfs_automount_list_static.dif:

From: Adrian Bunk <bunk@kernel.org>

Date: Mon, 14 Apr 2008 21:41:32 +0300

make nfs_automount_list static

nfs_automount_list can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-034-clean_up_task_locking.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Sat, 19 Apr 2008 18:41:49 -0400

SUNRPC: Fix a task locking race...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

linux-2.6.25-035-debug.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Wed, 16 Apr 2008 17:04:43 -0400

Debugging patch. Do _not_ merge

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[TXT]linux-2.6.25-001-fix..>2008-04-19 22:42 1.1K 
[TXT]linux-2.6.25-002-fix..>2008-04-19 22:42 6.0K 
[TXT]linux-2.6.25-003-don..>2008-04-19 22:42 1.6K 
[TXT]linux-2.6.25-004-fix..>2008-04-16 21:10 1.9K 
[TXT]linux-2.6.25-005-ens..>2008-04-16 21:10 5.3K 
[TXT]linux-2.6.25-006-ens..>2008-04-16 21:10 10K 
[TXT]linux-2.6.25-007-rea..>2008-04-19 22:42 6.7K 
[TXT]linux-2.6.25-008-rem..>2008-04-08 20:53 1.1K 
[TXT]linux-2.6.25-009-fix..>2008-04-08 20:53 7.8K 
[TXT]linux-2.6.25-010-fix..>2008-04-19 22:42 3.0K 
[TXT]linux-2.6.25-011-fix..>2008-04-08 20:53 2.1K 
[TXT]linux-2.6.25-012-fix..>2008-04-08 20:53 1.0K 
[TXT]linux-2.6.25-013-ref..>2008-04-08 20:53 1.6K 
[TXT]linux-2.6.25-014-con..>2008-04-08 20:53 5.2K 
[TXT]linux-2.6.25-015-rem..>2008-04-08 20:53 3.1K 
[TXT]linux-2.6.25-016-mak..>2008-04-08 20:53 1.5K 
[TXT]linux-2.6.25-017-fix..>2008-04-08 20:53 3.2K 
[TXT]linux-2.6.25-018-rem..>2008-04-08 20:53 1.2K 
[TXT]linux-2.6.25-019-nlm..>2008-04-08 20:53 4.0K 
[TXT]linux-2.6.25-020-cle..>2008-04-08 20:53 14K 
[TXT]linux-2.6.25-021-zer..>2008-04-08 20:53 2.0K 
[TXT]linux-2.6.25-022-fix..>2008-04-19 22:42 3.4K 
[TXT]linux-2.6.25-023-rei..>2008-04-19 22:42 6.4K 
[TXT]linux-2.6.25-024-use..>2008-04-16 21:10 2.7K 
[TXT]linux-2.6.25-025-del..>2008-04-16 21:10 1.4K 
[TXT]linux-2.6.25-026-rem..>2008-04-19 22:42 1.4K 
[TXT]linux-2.6.25-027-rem..>2008-04-19 22:42 683  
[TXT]linux-2.6.25-028-add..>2008-04-19 22:42 5.1K 
[TXT]linux-2.6.25-029-fix..>2008-04-19 22:42 2.1K 
[TXT]linux-2.6.25-030-fix..>2008-04-19 22:42 3.9K 
[TXT]linux-2.6.25-031-fix..>2008-04-19 22:42 2.3K 
[TXT]linux-2.6.25-032-rem..>2008-04-19 22:42 751  
[TXT]linux-2.6.25-033-mak..>2008-04-19 22:42 1.2K 
[TXT]linux-2.6.25-034-cle..>2008-04-19 22:42 2.7K 
[TXT]linux-2.6.25-035-deb..>2008-04-19 22:42 8.0K 
[   ]series 2008-04-19 22:42 1.7K 

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