summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NFSv4: Move nfs4_wait_clnt_recover and nfs4_client_recover_expired_leaseTrond Myklebust2012-12-063-36/+38
| | | | | | | | nfs4_wait_clnt_recover and nfs4_client_recover_expired_lease are both generic state related functions. As such, they belong in nfs4state.c, and not nfs4proc.c Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Clean up session drainingTrond Myklebust2012-12-065-35/+25
| | | | | | | | | Coalesce nfs4_check_drain_bc_complete and nfs4_check_drain_fc_complete into a single function that can be called when the slot table is known to be empty, then change nfs4_callback_free_slot() and nfs4_free_slot() to use it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: If slot allocation fails due to OOM, retry more quicklyTrond Myklebust2012-12-061-6/+11
| | | | | | | | If the NFSv4.1 session slot allocation fails due to an ENOMEM condition, then set the task->tk_timeout to 1/4 second to ensure that we do retry the slot allocation more quickly. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: CB_RECALL_SLOT must schedule a sequence op after updating targetsTrond Myklebust2012-12-063-0/+14
| | | | | | | | | | RFC5661 requires us to make sure that the server knows we've updated our slot table size by sending at least one SEQUENCE op containing the new 'highest_slotid' value. We can do so using the 'CHECK_LEASE' functionality of the state manager. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Remove the state manager code to resize the slot tableTrond Myklebust2012-12-064-55/+0
| | | | | | | | The state manager no longer needs any special machinery to stop the session flow and resize the slot table. It is all done on the fly by the SEQUENCE op code now. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Allow SEQUENCE to resize the slot table on the flyTrond Myklebust2012-12-064-80/+121
| | | | | | | Instead of an array of slots, use a singly linked list of slots that can be dynamically appended to or shrunk. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Support dynamic resizing of the session slot tableTrond Myklebust2012-12-063-5/+14
| | | | | | | | Allow the server to control the size of the session slot table by adjusting the value of sr_target_max_slots in the reply to the SEQUENCE operation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Allow the server to recall all but one slotTrond Myklebust2012-12-061-5/+0
| | | | | | | | If the server wants to leave us with only one slot, or it wants to "shrink" our slot table to something larger than we have now, then so be it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Don't confuse target_highest_slotid and max_slots in cb_recall_slotTrond Myklebust2012-12-063-9/+7
| | | | | | Don't confuse the table size and the target_highest_slotid... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Fix nfs4_callback_recallslot to work with dynamic slot allocationTrond Myklebust2012-12-063-1/+11
| | | | | | | Ensure that the NFSv4.1 CB_RECALL_SLOT callback updates the slot table target max slotid safely. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Reset the sequence number for slots that have been deallocatedTrond Myklebust2012-12-064-2/+22
| | | | | | | | When the server tells us that it is dynamically resizing the session replay cache, we should reset the sequence number for those slots that have been deallocated. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Ensure that the client tracks the server target_highest_slotidTrond Myklebust2012-12-066-9/+36
| | | | | | | | | | | | | | | | | Dynamic slot allocation in NFSv4.1 depends on the client being able to track the server's target value for the highest slotid in the slot table. See the reference in Section 2.10.6.1 of RFC5661. To avoid ordering problems in the case where 2 SEQUENCE replies contain conflicting updates to this target value, we also introduce a generation counter, to track whether or not an RPC containing a SEQUENCE operation was launched before or after the last update. Also rename the nfs4_slot_table target_max_slots field to 'target_highest_slotid' to avoid confusion with a slot table size or number of slots. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Clean up nfs4_free_slotTrond Myklebust2012-11-261-5/+7
| | | | | | | | | | Change the argument to take the pointer to the slot, instead of just the slotid. We know that the new value of highest_used_slot must be less than the current value. No need to scan the whole table. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Simplify slot allocationTrond Myklebust2012-11-261-15/+14
| | | | | | | | Clean up the NFSv4.1 slot allocation by replacing nfs_find_slot() with a function nfs_alloc_slot() that returns a pointer to the nfs4_slot instead of an offset into the slot table. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Simplify struct nfs4_sequence_args tooTrond Myklebust2012-11-263-16/+14
| | | | | | | Replace the session pointer + slotid with a pointer to the allocated slot. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Label each entry in the session slot tables with its slot numberTrond Myklebust2012-11-263-6/+9
| | | | | | | Instead of doing slot table pointer gymnastics every time we want to know which slot we're using. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Shrink struct nfs4_sequence_res by moving the session pointerTrond Myklebust2012-11-266-16/+33
| | | | | | | Move the session pointer into the slot table, then have struct nfs4_slot point to that slot table. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Shrink struct nfs4_sequence_res by moving sr_renewal_timeTrond Myklebust2012-11-212-7/+10
| | | | | | Store the renewal time inside the session slot instead. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: clean up nfs4_recall_slot to use nfs4_alloc_slotsTrond Myklebust2012-11-213-3/+4
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: nfs4_alloc_slots doesn't need zeroingTrond Myklebust2012-11-211-1/+1
| | | | | | | All that memory is going to be initialised to non-zero by nfs4_add_and_init_slots anyway. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: We must bump the clientid sequence number after CREATE_SESSIONTrond Myklebust2012-11-211-2/+1
| | | | | | | | We must always bump the clientid sequence number after a successful call to CREATE_SESSION on the server. The result of nfs4_verify_channel_attrs() is irrelevant to that requirement. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Adjust CREATE_SESSION arguments when mounting a new filesystemTrond Myklebust2012-11-211-0/+13
| | | | | | | | If we're mounting a new filesystem, ensure that the session has negotiated large enough request and reply sizes to match the wsize and rsize mount arguments. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Don't confuse CREATE_SESSION arguments and resultsTrond Myklebust2012-11-212-13/+20
| | | | | | | Don't store the target request and response sizes in the same variables used to store the server's replies to those targets. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Handle session reset and bind_conn_to_session before lease checkTrond Myklebust2012-11-211-9/+8
| | | | | | | | We can't send a SEQUENCE op unless the session is OK, so it is pointless to handle the CHECK_LEASE state before we've dealt with SESSION_RESET and BIND_CONN_TO_SESSION. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Add sequence_priviliged_ops for nfs4_proc_sequence()Bryan Schumaker2012-11-201-4/+17
| | | | | | | | | | | | | | | | | | | If I mount an NFS v4.1 server to a single client multiple times and then run xfstests over each mountpoint I usually get the client into a state where recovery deadlocks. The server informs the client of a cb_path_down sequence error, the client then does a bind_connection_to_session and checks the status of the lease. I found that bind_connection_to_session sets the NFS4_SESSION_DRAINING flag on the client, but this flag is never unset before nfs4_check_lease() reaches nfs4_proc_sequence(). This causes the client to deadlock, halting all NFS activity to the server. nfs4_proc_sequence() is only called by the state manager, so I can change it to run in privileged mode to bypass the NFS4_SESSION_DRAINING check and avoid the deadlock. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
* 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>
OpenPOWER on IntegriCloud