summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linuxLinus Torvalds2012-12-205-60/+61
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull nfsd update from Bruce Fields: "Included this time: - more nfsd containerization work from Stanislav Kinsbursky: we're not quite there yet, but should be by 3.9. - NFSv4.1 progress: implementation of basic backchannel security negotiation and the mandatory BACKCHANNEL_CTL operation. See http://wiki.linux-nfs.org/wiki/index.php/Server_4.0_and_4.1_issues for remaining TODO's - Fixes for some bugs that could be triggered by unusual compounds. Our xdr code wasn't designed with v4 compounds in mind, and it shows. A more thorough rewrite is still a todo. - If you've ever seen "RPC: multiple fragments per record not supported" logged while using some sort of odd userland NFS client, that should now be fixed. - Further work from Jeff Layton on our mechanism for storing information about NFSv4 clients across reboots. - Further work from Bryan Schumaker on his fault-injection mechanism (which allows us to discard selective NFSv4 state, to excercise rarely-taken recovery code paths in the client.) - The usual mix of miscellaneous bugs and cleanup. Thanks to everyone who tested or contributed this cycle." * 'for-3.8' of git://linux-nfs.org/~bfields/linux: (111 commits) nfsd4: don't leave freed stateid hashed nfsd4: free_stateid can use the current stateid nfsd4: cleanup: replace rq_resused count by rq_next_page pointer nfsd: warn on odd reply state in nfsd_vfs_read nfsd4: fix oops on unusual readlike compound nfsd4: disable zero-copy on non-final read ops svcrpc: fix some printks NFSD: Correct the size calculation in fault_inject_write NFSD: Pass correct buffer size to rpc_ntop nfsd: pass proper net to nfsd_destroy() from NFSd kthreads nfsd: simplify service shutdown nfsd: replace boolean nfsd_up flag by users counter nfsd: simplify NFSv4 state init and shutdown nfsd: introduce helpers for generic resources init and shutdown nfsd: make NFSd service structure allocated per net nfsd: make NFSd service boot time per-net nfsd: per-net NFSd up flag introduced nfsd: move per-net startup code to separated function nfsd: pass net to __write_ports() and down nfsd: pass net to nfsd_set_nrthreads() ...
| * nfsd4: cleanup: replace rq_resused count by rq_next_page pointerJ. Bruce Fields2012-12-174-7/+11
| | | | | | | | | | | | | | It may be a matter of personal taste, but I find this makes the code clearer. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: fix some printksJ. Bruce Fields2012-12-171-4/+4
| | | | | | | | | | Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * SUNRPC: remove redundant "linux/nsproxy.h" includesStanislav Kinsbursky2012-12-102-2/+0
| | | | | | | | | | | | | | This is a cleanup patch. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: support multiple-fragment rpc'sJ. Bruce Fields2012-12-041-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Over TCP, RPC's are preceded by a single 4-byte field telling you how long the rpc is (in bytes). The spec also allows you to send an RPC in multiple such records (the high bit of the length field is used to tell you whether this is the final record). We've survived for years without supporting this because in practice the clients we care about don't use it. But the userland rpc libraries do, and every now and then an experimental client will run into this. (Most recently I noticed it while trying to write a pynfs check.) And we're really on the wrong side of the spec here--let's fix this. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: track rpc data length separately from sk_tcplenJ. Bruce Fields2012-12-041-7/+12
| | | | | | | | | | | | | | | | | | | | | | Keep a separate field, sk_datalen, that tracks only the data contained in a fragment, not including the fragment header. For now, this is always just max(0, sk_tcplen - 4), but after we allow multiple fragments sk_datalen will accumulate the total rpc data size while sk_tcplen only tracks progress receiving the current fragment. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: fix off-by-4 error in "incomplete TCP record" dprintkJ. Bruce Fields2012-12-041-1/+2
| | | | | | | | | | | | | | The full reclen doesn't include the fragment header, but sk_tcplen does. Fix this to make it an apples-to-apples comparison. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: delay minimum-rpc-size check till laterJ. Bruce Fields2012-12-041-9/+7
| | | | | | | | | | | | | | | | | | | | Soon we want to support multiple fragments, in which case it may be legal for a single fragment to be smaller than 8 bytes, so we'll want to delay this check till we've reached the last fragment. Also fix an outdated comment. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: don't byte-swap sk_reclen in placeJ. Bruce Fields2012-12-041-15/+11
| | | | | | | | | | | | | | | | | | Byte-swapping in place is always a little dubious. Let's instead define this field to always be big-endian, and do the swapping on demand where we need it. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| * svcrpc: demote some printks to a dprintkJ. Bruce Fields2012-11-071-3/+2
| | | | | | | | | | | | | | In general I'd rather random bad behavior on the network won't trigger a printk. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* | SUNRPC: continue run over clients list on PipeFS event instead of breakStanislav Kinsbursky2012-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There are SUNRPC clients, which program doesn't have pipe_dir_name. These clients can be skipped on PipeFS events, because nothing have to be created or destroyed. But instead of breaking in case of such a client was found, search for suitable client over clients list have to be continued. Otherwise some clients could not be covered by PipeFS event handler. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Cc: stable@vger.kernel.org [>= v3.4] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC: variable 'svsk' is unused in function bc_send_requestTrond Myklebust2012-12-151-2/+0
| | | | | | | | | | | | Silence a compile time warning. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC: Handle ECONNREFUSED in xs_local_setup_socketTrond Myklebust2012-12-151-0/+4
| | | | | | | | | | | | | | Silence the unnecessary warning "unhandled error (111) connecting to..." and convert it to a dprintk for debugging purposes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC handle EKEYEXPIRED in call_refreshresultAndy Adamson2012-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when an RPCSEC_GSS context has expired or is non-existent and the users (Kerberos) credentials have also expired or are non-existent, the client receives the -EKEYEXPIRED error and tries to refresh the context forever. If an application is performing I/O, or other work against the share, the application hangs, and the user is not prompted to refresh/establish their credentials. This can result in a denial of service for other users. Users are expected to manage their Kerberos credential lifetimes to mitigate this issue. Move the -EKEYEXPIRED handling into the RPC layer. Try tk_cred_retry number of times to refresh the gss_context, and then return -EACCES to the application. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC set gss gc_expiry to full lifetimeAndy Adamson2012-12-121-4/+13
| | | | | | | | | | | | | | | | | | | | Only use the default GSSD_MIN_TIMEOUT if the gss downcall timeout is zero. Store the full lifetime in gc_expiry (not 3/4 of the lifetime) as subsequent patches will use the gc_expiry to determine buffered WRITE behavior in the face of expired or soon to be expired gss credentials. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | Merge branch 'bugfixes' into nfs-for-nextTrond Myklebust2012-12-111-1/+6
|\ \
| * | SUNRPC: Fix validity issues with rpc_pipefs sb->s_fs_infoTrond Myklebust2012-11-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpc_kill_sb() must defer calling put_net() until after the notifier has been called, since most (all?) of the notifier callbacks assume that sb->s_fs_info points to a valid net namespace. It also must not call put_net() if the call to rpc_fill_super was unsuccessful. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=48421 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Stanislav Kinsbursky <skinsbursky@parallels.com> Cc: stable@vger.kernel.org [>= v3.4]
* | | SUNRPC: Don't allow low priority tasks to pre-empt higher priority onesTrond Myklebust2012-12-061-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the priority queues attempt to be 'fair' to lower priority tasks by scheduling them after a certain number of higher priority tasks have run. The problem is that both the transport send queue and the NFSv4.1 session slot queue have strong ordering requirements. This patch therefore removes the fairness code in favour of strong ordering of task priorities. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4.1: Don't mess with task priorities in nfs41_setup_sequenceTrond Myklebust2012-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | We want to preserve the rpc_task priority for things like writebacks, that may have differing levels of urgency. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: Clean up rpc_bind_new_programTrond Myklebust2012-11-041-10/+8
| | | | | | | | | | | | | | | | | | | | | We can and should use the rpc_create_args and __rpc_clone_client() to change the program and version number on the resulting rpc_client. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from rpc_call_syncWeston Andros Adamson2012-11-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Use WARN_ON_ONCE instead of calling BUG_ON and return -EINVAL when RPC_TASK_ASYNC flag is passed to rpc_call_sync. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in rpc_release_taskWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in svc_delete_xprtWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ONs checking RPC_IS_QUEUEDWeston Andros Adamson2012-11-041-2/+6
| | | | | | | | | | | | | | | | | | | | | Replace two BUG_ON() calls with WARN_ON_ONCE() and early returns. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from __rpc_sleep_on_priorityWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in svc_registerWeston Andros Adamson2012-11-041-1/+3
| | | | | | | | | | | | | | | | | | | | | Instead of calling BUG_ON(), do a WARN_ON_ONCE() and return -EINVAL. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from encode_rpcb_stringWeston Andros Adamson2012-11-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE() and truncate the encoded string if len > max. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from bc_mallocWeston Andros Adamson2012-11-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE() and NULL return - the caller will handle this like a memory allocation failure. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in xdr_shrink_bufheadWeston Andros Adamson2012-11-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Replace bounds checking BUG_ON() with a WARN_ON_ONCE() and resetting the requested len to the max. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ONs checking RPCSVC_MAXPAGESWeston Andros Adamson2012-11-042-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Replace two bounds checking BUG_ON() calls with WARN_ON_ONCE() and resetting the requested size to RPCSVC_MAXPAGES. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in svc_xprt_receivedWeston Andros Adamson2012-11-041-1/+3
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with a WARN_ON_ONCE() and early return. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ONs from *_reclassify_socket*Weston Andros Adamson2012-11-042-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace multiple BUG_ON() calls with WARN_ON_ONCE() and early return when sanity checking socket ownership (lock). The bind call will fail if the socket was unsuccessfully reclassified. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from svc_pool_map_set_cpumaskWeston Andros Adamson2012-11-041-1/+3
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with a WARN() and early return. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove two BUG_ON assertsWeston Andros Adamson2012-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Replace two BUG_ON() calls checking the RPC_BC_PA_IN_USE flag with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in rpc_put_sb_netWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON() - the condition is definitely a misuse of the API, but shouldn't cause a crash. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON calls from cache_readWeston Andros Adamson2012-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE() in two parts of cache_read(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from bc_sendWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE(). The error condition is a simple ref counting sanity check and the following code will not free anything until final put. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from xprt_destroy_backchannelWeston Andros Adamson2012-11-041-1/+4
| | | | | | | | | | | | | | | | | | | | | If max_reqs is 0, do nothing besides the usual dprintks. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from rpc_sleep_on*Weston Andros Adamson2012-11-041-2/+12
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE() and clean up after inactive task. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from call_bc_transmitWeston Andros Adamson2012-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | Remove redundant BUG_ON(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from call_bc_transmitWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from call_transmitWeston Andros Adamson2012-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | Remove unneeded BUG_ON() Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON from rpc_run_bc_taskWeston Andros Adamson2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace BUG_ON() with WARN_ON_ONCE() - rpc_run_bc_task calls rpc_init_task() then increments the tk_count, so this is a simple sanity check that if hit once would hit every time this code path is executed. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: remove BUG_ON in __rpc_clnt_handle_eventWeston Andros Adamson2012-11-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Print a KERN_INFO message before rpc_d_lookup_sb returns NULL, like other error paths in that function. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | SUNRPC: add WARN_ON_ONCE for potential deadlockWeston Andros Adamson2012-11-041-0/+7
|/ / | | | | | | | | | | | | | | | | rpc_shutdown_client should never be called from a workqueue context. If it is, it could deadlock looping forever trying to kill tasks that are assigned to the same kworker thread (and will never run rpc_exit_task). Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC: return proper errno from backchannel_rqstWeston Andros Adamson2012-11-011-1/+1
| | | | | | | | | | | | | | | | The one and only caller (in fs/nfs/nfs4client.c) uses the result as an errno and would have interpreted an error as EPERM. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | SUNRPC: Get rid of the xs_error_report socket callbackTrond Myklebust2012-10-241-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chris Perl reports that we're seeing races between the wakeup call in xs_error_report and the connect attempts. Basically, Chris has shown that in certain circumstances, the call to xs_error_report causes the rpc_task that is responsible for reconnecting to wake up early, thus triggering a disconnect and retry. Since the sk->sk_error_report() calls in the socket layer are always followed by a tcp_done() in the cases where we care about waking up the rpc_tasks, just let the state_change callbacks take responsibility for those wake ups. Reported-by: Chris Perl <chris.perl@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org Tested-by: Chris Perl <chris.perl@gmail.com>
* | SUNRPC: Prevent races in xs_abort_connection()Trond Myklebust2012-10-241-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to xprt_disconnect_done() that is triggered by a successful connection reset will trigger another automatic wakeup of all tasks on the xprt->pending rpc_wait_queue. In particular it will cause an early wake up of the task that called xprt_connect(). All we really want to do here is clear all the socket-specific state flags, so we split that functionality out of xs_sock_mark_closed() into a helper that can be called by xs_abort_connection() Reported-by: Chris Perl <chris.perl@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org Tested-by: Chris Perl <chris.perl@gmail.com>
* | Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."Trond Myklebust2012-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 55420c24a0d4d1fce70ca713f84aa00b6b74a70e. Now that we clear the connected flag when entering TCP_CLOSE_WAIT, the deadlock described in this commit is no longer possible. Instead, the resulting call to xs_tcp_shutdown() can interfere with pending reconnection attempts. Reported-by: Chris Perl <chris.perl@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org Tested-by: Chris Perl <chris.perl@gmail.com>
* | SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAITTrond Myklebust2012-10-241-0/+1
|/ | | | | | | | | This is needed to ensure that we call xprt_connect() upon the next call to call_connect(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org Tested-by: Chris Perl <chris.perl@gmail.com>
OpenPOWER on IntegriCloud