aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2009-06-17NFS: Fix false error return from nfs_callback_up() if ipv6.ko is not availableChuck Lever1-1/+3
Clear "ret" if the error return from svc_create_xprt(AF_INET6) was -EAFNOSUPORT. Otherwise, callback start-up will succeed, but nfs_callback_up() will return -EAFNOSUPPORT anyway, and the first NFSv4 mount attempt after a reboot will fail. Bug introduced by commit f738f517 in 2.6.30-rc1. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: Return error code from nfs_callback_up() to user spaceChuck Lever1-4/+8
If the kernel cannot start the NFSv4 callback service during a mount request, it returns -ENOMEM to user space, resulting in this message: mount.nfs4: Cannot allocate memory Adjust nfs_alloc_client() and nfs_get_client() to pass NFSv4 callback start-up errors back to user space so a less mysterious error message can be displayed by the mount command. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: Do not display the setting of the "intr" mount optionChuck Lever1-1/+0
The "intr" mount option has been deprecated for a while, but /proc/mounts continues to display "nointr" whether "intr" or "nointr" has been specified for a mount point. Since these options do not have any effect, simply do not display them. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: add support for splice writesSuresh Jayaraman1-0/+31
Adds support for splice writes. It effectively calls generic_file_splice_write() to do the writes. We need not worry about O_APPEND case as the combination of splice() writes and O_APPEND is disallowed. This patch propagates NFS write errors back to the caller. The number of bytes written via splice are being added to NFSIO_NORMALWRITTENBYTES as these are effectively cached writes. Signed-off-by: Suresh Jayaraman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17Merge commit 'linux-pnfs/nfs41-for-2.6.31' into nfsv41-for-2.6.31Trond Myklebust17-296/+3307
2009-06-17jbd2: clean up jbd2_journal_try_to_free_buffers()Hisashi Hifumi1-49/+0
This patch reverts 3f31fddf, which is no longer needed because if a race between freeing buffer and committing transaction functionality occurs and dio gets error, currently dio falls back to buffered IO due to the commit 6ccfa806. Signed-off-by: Hisashi Hifumi <[email protected]> Cc: Mingming Cao <[email protected]> Acked-by: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2009-06-17nfs41: Backchannel: CB_SEQUENCE validationRicardo Labiaga1-4/+67
Validates the callback's sessionID, the slot number, and the sequence ID. Increments the slot's sequence. Detects replays, but simply prints a debug message (if debugging is enabled since we don't yet implement a duplicate request cache for the backchannel. This should not present a problem, since only idempotent callbacks are currently implemented. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Backchannel: Be more obvious about the return value] [nfs41: Backchannel: dprink in host order] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Backchannel: New find_client_with_session()Ricardo Labiaga1-0/+36
Finds the 'struct nfs_client' that matches the server's address, major version number, and session ID. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Backchannel: Add a backchannel slot table to the sessionRicardo Labiaga1-12/+36
Defines a new 'struct nfs4_slot_table' in the 'struct nfs4_session' for use by the backchannel. Initializes, resets, and destroys the backchannel slot table in the same manner the forechannel slot table is initialized, reset, and destroyed. The sequenceid for each slot in the backchannel slot table is initialized to 0, whereas the forechannel slotid's sequenceid is set to 1. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Backchannel: Refactor nfs4_init_slot_table()Ricardo Labiaga1-7/+19
Generalize nfs4_init_slot_table() so it can be used to initialize the backchannel slot table in addition to the forechannel slot table. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Backchannel: Refactor nfs4_reset_slot_table()Ricardo Labiaga1-11/+27
Generalize nfs4_reset_slot_table() so it can be used to reset the backchannel slot table in addition to the forechannel slot table. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Backchannel: update cb_sequence args and resultsRicardo Labiaga2-3/+3
Change the type of cs_addr and csr_status to 'struct sockaddr' and '__be32' since the cb_sequence processing function will use existing functionality that expects these types. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: verify CB_SEQUENCE position in callback compoundBenny Halevy1-0/+8
CB_SEQUENCE must appear first in the callback compound RPC. If it is not the first operation NFS4ERR_SEQUENCE_POS must be returned. If the first operation ni the CB_COMPOUND is not CB_SEQUENCE then NFS4ERR_OP_NOT_IN_SESSION must be returned. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: refactor op preprocessing out of process_op] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: cb_sequence xdr implementationBenny Halevy1-2/+170
[nfs41: get rid of READMEM and COPYMEM for callback_xdr.c] Signed-off-by: Benny Halevy <[email protected]> [nfs41: get rid of READ64 in callback_xdr.c] See http://linux-nfs.org/pipermail/pnfs/2009-June/007846.html Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: cb_sequence proc implementationBenny Halevy2-0/+32
Currently, just free up any referring calls information. Signed-off-by: Benny Halevy <[email protected]> [nfs41: fix csr_{,target}highestslotid] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: cb_sequence protocol level data structuresBenny Halevy1-0/+35
Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: consider minorversion in callback_xdr:process_opBenny Halevy2-14/+72
Note that this patch changes the nfsv4.0 behavior also when CONFIG_NFS_V4_1 is not defined where NFS4ERR_MINOR_VERS_MISMATCH will be returned if the client received a CB_COMPOUND with minorversion != 0. Previously, it would have returned NFS4ERR_OP_ILLEGAL for CB_SEQUENCE. (or if the server is broken and sent OP_CB_GETATTR or OP_CB_RECALL with minorversion!=0, they would have been processed normally. Signed-off-by: Benny Halevy <[email protected]> [nfs41: refactor op preprocessing out of process_op] See http://linux-nfs.org/pipermail/pnfs/2009-June/007845.html [nfs41: define CB_NOTIFY_DEVICEID as not supported] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: callback numbers definitionsBenny Halevy1-0/+10
Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: decode minorversion 1 cb_compound headerBenny Halevy2-4/+4
decode cb_compound header conforming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 Get rid of cb_compound_hdr_arg.callback_ident callback_ident is not used anywhere so we shouldn't waste any memory to store it. Signed-off-by: Benny Halevy <[email protected]> [nfs41: no need to break read_buf in decode_compound_hdr_arg] See http://linux-nfs.org/pipermail/pnfs/2009-June/007844.html Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: store minorversion in cb_compound_hdr_argBenny Halevy2-5/+8
Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Release backchannel resources associated with sessionAndy Adamson2-1/+6
Frees the preallocated backchannel resources that are associated with this session when the session is destroyed. A backchannel is currently created once per session. Destroy the backchannel only when the session is destroyed. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Client indicates presence of NFSv4.1 callback channel.Andy Adamson1-1/+1
Set the SESSION4_BACK_CHAN flag to indicate the client supports a backchannel. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Setup the backchannelAndy Adamson1-0/+9
The NFS v4.1 callback service has already been setup, and rpc_xprt->serv points to the svc_serv structure describing it. Invoke the xprt_setup_backchannel() initialization to pre- allocate the necessary backchannel structures. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: change nfs4_put_session(nfs4_session**) to nfs4_destroy_session(nfs_session*)] Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [moved xprt_setup_backchannel from nfs4_init_session to nfs4_init_backchannel] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Allow NFSv4 and NFSv4.1 callback services to coexistAndy Adamson3-32/+27
Tracks the nfs_callback_info for both versions, enabling the callback service for v4 and v4.1 to run concurrently and be stopped independently of each other. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: create a svc_xprt for nfs41 callback thread and use for incoming ↵Benny Halevy1-1/+16
callbacks Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Implement NFSv4.1 callback service process.Ricardo Labiaga2-4/+115
nfs41_callback_up() initializes the necessary queues and creates the new nfs41_callback_svc thread. This thread executes the callback service which waits for requests to arrive on the svc_serv->sv_cb_list. NFS41_BC_MIN_CALLBACKS is set to 1 because we expect callbacks to not cause substantial latency. The actual processing of the callback will be implemented as a separate patch. There is only one NFSv4.1 callback service. The first caller of nfs4_callback_up() creates the service, subsequent callers increment a reference count on the service. The service is destroyed when the last caller invokes nfs_callback_down(). The transport needs to hold a reference to the callback service in order to invoke it during callback processing. Currently this reference is only obtained when the service is first created. This is incorrect, since subsequent registrations for other transports will leave the xprt->serv pointer uninitialized, leading to an oops when a callback arrives on the "unreferenced" transport. This patch fixes the problem by ensuring that a reference to the service is saved in xprt->serv, either because the service is created by this invocation to nfs4_callback_up() or by a prior invocation. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Add a reference to svc_serv during callback service bring up] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [Type check arguments of nfs_callback_up] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: save svc_serv in nfs_callback_info] Signed-off-by: Benny Halevy <[email protected]> [Removal of ugly #ifdefs] [nfs41: Update to removal of ugly #ifdefs] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17NFSv4/NLM: Push file locking BKL dependencies down into the NLM layerTrond Myklebust2-6/+2
Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: Ensure we always hold the BKL when dereferencing inode->i_flockTrond Myklebust2-2/+23
Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFSv4: Handle more errors when recovering open file and locking stateTrond Myklebust2-16/+56
It is possible for servers to return NFS4ERR_BAD_STATEID when the state management code is recovering locks or is reclaiming state when returning a delegation. Ensure that we handle that case. While we're at it, add in handlers for NFS4ERR_STALE, NFS4ERR_ADMIN_REVOKED, NFS4ERR_OPENMODE, NFS4ERR_DENIED and NFS4ERR_STALE_STATEID, since the protocol appears to allow for them too. Also handle ENOMEM... Finally, rather than add new NFSv4.0-specific errors and error handling into the generic delegation code, move that open file and locking state error handling into the NFSv4 layer. Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFSv4: Move error handling out of the delegation generic codeTrond Myklebust2-17/+16
The NFSv4 delegation recovery code is required by the protocol to handle more errors. Rather than add NFSv4.0 specific errors into 'generic' delegation code, we should move the error handling into the NFSv4 layer. Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFSv4: Fix the 'nolock' option regressionTrond Myklebust1-0/+7
NFSv4 should just ignore the 'nolock' option. It is an NFSv2/v3 thing... This fixes the Oops in http://bugzilla.kernel.org/show_bug.cgi?id=13330 Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: minorversion support for nfs4_{init,destroy}_callbackBenny Halevy3-34/+54
move nfs4_init_callback into nfs4_init_client_minor_version and nfs4_destroy_callback into nfs4_clear_client_minor_version as these need to happen also when auto-negotiating the minorversion once the callback service for nfs41 becomes different than for nfs4.0 Signed-off-by: Benny Halevy <[email protected]> [nfs41: Fix checkpatch warning] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [Type check arguments of nfs_callback_up] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Backchannel: Remove FIXME comment] Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: Refactor nfs4_{init,destroy}_callback for nfs4.0Benny Halevy1-9/+37
Refactor-out code to bring the callback service up and down. Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: increment_{open,lock}_seqidBenny Halevy2-5/+9
Unlike minorversion0, in nfsv4.1 the open and lock seqids need not be incremented by the client and should always be set to zero. This is implemented using a new nfs_rpc_ops methods - increment_open_seqid and increment_lock_seqid Signed-off-by: Rahul Iyer <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: only retry EXCHANGE_ID on recoverable errorsAndy Adamson1-1/+22
Stops an infinite loop of EXCHANGE_ID. Signed-off-by: Andy Adamson <[email protected]> [fixed checkpatch warnings] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: recover lease in _nfs4_lookup_rootBenny Halevy3-1/+25
This creates the nfsv4.1 session on mount. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: get_clid_cred for EXCHANGE_IDAndy Adamson3-0/+17
Unlike SETCLIENTID, EXCHANGE_ID requires a machine credential. Do not search for credentials other than the machine credential. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: add a get_clid_cred function to nfs4_state_recovery_opsAndy Adamson3-1/+4
EXCHANGE_ID has different credential requirements than SETCLIENTID. Prepare for a separate credential function. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: establish sessions-based clientidAndy Adamson3-8/+50
nfsv4.1 clientid is established via EXCHANGE_ID rather than SETCLIENTID{,_CONFIRM} This is implemented using a new establish_clid method in nfs4_state_recovery_ops. nfs41: establish clientid via exchange id only if cred != NULL >From 2.6.26 reclaimer() uses machine cred for setting up the client id therefore it is never expected to be NULL. Signed-off-by: Rahul Iyer <[email protected]> [removed dprintk] Signed-off-by: Benny Halevy <[email protected]> [nfs41: lease renewal] [revamped patch for new nfs4_state_manager design] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: introduce get_state_renewal_credAndy Adamson4-14/+14
Use the machine cred for sending SEQUENCE to renew the client's lease. [revamp patch for new state management design starting 2.6.29] [nfs41: support minorversion 1 for nfs4_check_lease] Signed-off-by: Benny Halevy <[email protected]> [nfs41: get cred in exchange_id when cred arg is NULL] Signed-off-by: Benny Halevy <[email protected]> [nfs41: use cl_machined_cred instead of cl_ex_cred] Since EXCHANGE_ID insists on using the machine credential, cl_ex_cred is not needed. nfs4_proc_exchange_id() is only called if the machine credential is available. Remove the credential logic from nfs4_proc_exchange_id. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: support minorversion 1 for nfs4_check_leaseBenny Halevy3-1/+6
[moved nfs4_get_renew_cred related changes to "nfs41: introduce get_state_renewal_cred"] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: lease renewalBenny Halevy3-1/+33
Send a NFSv4.1 SEQUENCE op rather than RENEW that was deprecated in minorversion 1. Use the nfs_client minorversion to select reboot_recover/ network_partition_recovery/state_renewal ops. Note: we use reclaimer to create the nfs41 session before there are any cl_superblocks for the nfs_client. Signed-off-by: Benny Halevy <[email protected]> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [revamped patch for new nfs4_state_manager design] Signed-off-by: Benny Halevy <[email protected]> [nfs41: obliterate nfs4_state_recovery_ops.renew_lease method] moved to nfs4_state_maintenance_ops [also undid per-minorversion nfs4_state_recovery_ops here] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: schedule async session resetAndy Adamson1-0/+34
Define a new session reset state which is set upon a sequence operation error in both the sync and async error handlers. Place all new requests and all but the last outstanding rpc on the slot_tbl_waitq. Spawn the recovery thread when the last slot is free. Call nfs4_proc_destroy_session, reinitialize the session, call nfs4_proc_create_session, clear the session reset state, and wake up the next task on the slot_tbl_waitq. Return the nfs4_proc_destroy_session status to the session reclaimer and check for NFS4ERR_BADSESSION and NFS4ERR_DEADSESSION. Other destroy session errors should be handled in nfs4_proc_destroy_session where the call can be retried with adjusted arguments. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> nfs41: make nfs4_wait_bit_killable public] nfs4_wait_bit_killable to be used by NFSv4.1 session recover logic. Signed-off-by: Rahul Iyer <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: have create_session work on nfs_client] Signed-off-by: Andy Adamson <[email protected]> [nfs41: trigger the state manager for session reset] Replace the session reset state with the NFS4CLNT_SESSION_SETUP cl_state. Place all rpc tasks to sleep on the slot table waitqueue until the slot table is drained, then schedule state recovery and wait for it to complete. Signed-off-by: Andy Adamson <[email protected]> [nfs41: remove nfs41_session_recovery [ch] Replaced by using the nfs4_state_manager. Signed-off-by: Andy Adamson <[email protected]> [nfs41: nfs4_wait_bit_killable only used locally] [nfs41: keep nfs4_wait_bit_killable static] [nfs41: keep const nfs_server in nfs4_handle_exception] [nfs41: remove session parameter from nfs4_find_slot] Signed-off-by: Andy Adamson <[email protected] Signed-off-by: Benny Halevy <[email protected]> [nfs41: resset the session from nfs41_setup_sequence] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: kick start nfs41 session recovery when handling errorsAndy Adamson1-0/+32
Remove checking for any errors that the SEQUENCE operation does not return. -NFS4ERR_STALE_CLIENTID, NFS4ERR_EXPIRED, NFS4ERR_CB_PATH_DOWN, NFS4ERR_BACK_CHAN_BUSY, NFS4ERR_OP_NOT_IN_SESSION. SEQUENCE operation error recovery is very primative, we only reset the session. Remove checking for any errors that are returned by the SEQUENCE operation, but that resetting the session won't address. NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_SEQUENCE_POS,NFS4ERR_TOO_MANY_OPS. Add error checking for missing SEQUENCE errors that a session reset will address. NFS4ERR_BAD_HIGH_SLOT, NFS4ERR_DEADSESSION, NFS4ERR_SEQ_FALSE_RETRY. A reset of the session is currently our only response to a SEQUENCE operation error. Don't reset the session on errors where a new session won't help. Don't reset the session on errors where a new session won't help. [nfs41: nfs4_async_handle_error update error checking] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: trigger the state manager for session reset] Replace session state bit with nfs_client state bit. Set the NFS4CLNT_SESSION_SETUP bit upon a session related error in the sync/async error handlers. [nfs41: _nfs4_async_handle_error fix session reset error list] Sequence operation errors that session reset could help. NFS4ERR_BADSESSION NFS4ERR_BADSLOT NFS4ERR_BAD_HIGH_SLOT NFS4ERR_DEADSESSION NFS4ERR_CONN_NOT_BOUND_TO_SESSION NFS4ERR_SEQ_FALSE_RETRY NFS4ERR_SEQ_MISORDERED Sequence operation errors that a session reset would not help NFS4ERR_BADXDR NFS4ERR_DELAY NFS4ERR_REP_TOO_BIG NFS4ERR_REP_TOO_BIG_TO_CACHE NFS4ERR_REQ_TOO_BIG NFS4ERR_RETRY_UNCACHED_REP NFS4ERR_SEQUENCE_POS NFS4ERR_TOO_MANY_OPS Signed-off-by: Andy Adamson <[email protected]> [nfs41 nfs4_handle_exception fix session reset error list] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [moved nfs41_sequece_call_done code to nfs41: sequence operation] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use rpc prepare call state for session resetAndy Adamson5-25/+41
[nfs41: change nfs4_restart_rpc argument] [nfs41: check for session not minorversion] [nfs41: trigger the state manager for session reset] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [always define nfs4_restart_rpc] Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: add session reset to state managerAndy Adamson2-2/+50
Move the code to reset a session from the session_reclaimer to the nfs4_state_manager. Destroy the session, and create a new one. Treat NFS4ERR_BADSESSION and NFS4ERR_DEADSESSION as a successful nfs4_proc_destroy_session. Signal nfs4_proc_create_session that this is a session reset so that the session slot table is re-used. If the clientid is stale, set both NFS4CLNT_LEASE_EXPIRED and NFS4CLNT_SESSION_SETUP bits and retry. Use a switch statement in nfs4_session_recovery_handle_error for future patche which will add handling for other errors. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: session reset in nfs4_recovery_handle_error] Signed-off-by: Andy Adamson <[email protected]> [nfs41: reset session on nfs4_do_reclaim session reset error] If nfs4_do_reclaim gets a session reset error, nfs4_recovery_handle_error will set the NFS4CLNT_SESSION_SETUP bit, and the state manager should continue processing to reset the session. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [move nfs4_proc_destroy_session declaration here] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: add session setup to the state managerAndy Adamson5-5/+53
At mount, nfs_alloc_client sets the cl_state NFS4CLNT_LEASE_EXPIRED bit and nfs4_alloc_session sets the NFS4CLNT_SESSION_SETUP bit, so both bits are set when nfs4_lookup_root calls nfs4_recover_expired_lease which schedules the nfs4_state_manager and waits for it to complete. Place the session setup after the clientid establishment in nfs4_state_manager so that the session is setup right after the clientid has been established without rescheduling the state manager. Unlike nfsv4.0, the nfs_client struct is not ready to use until the session has been established. Postpone marking the nfs_client struct to NFS_CS_READY until after a successful CREATE_SESSION call so that other threads cannot use the client until the session is established. If the EXCHANGE_ID call fails and the session has not been setup (the NFS4CLNT_SESSION_SETUP bit is set), mark the client with the error and return. If the session setup CREATE_SESSION call fails with NFS4ERR_STALE_CLIENTID which could occur due to server reboot or network partition inbetween the EXCHANGE_ID and CREATE_SESSION call, reset the NFS4CLNT_LEASE_EXPIRED and NFS4CLNT_SESSION_SETUP bits and try again. If the CREATE_SESSION call fails with other errors, mark the client with the error and return. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: NFS_CS_SESSION_SETUP cl_cons_state for back channel setup] On session setup, the CREATE_SESSION reply races with the server back channel probe which needs to succeed to setup the back channel. Set a new cl_cons_state NFS_CS_SESSION_SETUP just prior to the CREATE_SESSION call and add it as a valid state to nfs_find_client so that the client back channel can find the nfs_client struct and won't drop the server backchannel probe. Use a new cl_cons_state so that NFSv4.0 back channel behaviour which only sets NFS_CS_READY is unchanged. Adjust waiting on the nfs_client_active_wq accordingly. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: rename NFS_CS_SESSION_SETUP to NFS_CS_SESSION_INITING] Signed-off-by: Andy Adamson <[email protected]> [nfs41: set NFS_CL_SESSION_INITING in alloc_session] Signed-off-by: Andy Adamson <[email protected]> [nfs41: move session setup into a function] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [moved nfs4_proc_create_session declaration here] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: reset the session slot tableAndy Adamson1-3/+41
Separated from nfs41: schedule async session reset Do not kfree the session slot table upon session reset, just re-initialize it. Add a boolean to nfs4_proc_create_session to inidicate if this is a session reset or a session initialization. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: sequence operationAndy Adamson2-5/+214
Implement the sequence operation conforming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 Check returned sessionid, slotid and slot sequenceid in decode_sequence. If the server returns different values for sessionID, slotID or slot sequence number than what was sent, the server is looney tunes. Pass the sequence operation status to nfs41_sequence_done in order to determine when to increment the slot sequence ID. Free slot is separated from sequence done. Signed-off-by: Rahul Iyer <[email protected]> Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Andy Adamson<[email protected]> [nfs41: sequence res use slotid] Signed-off-by: Andy Adamson <[email protected]> [nfs41: deref slot table in decode_sequence only for minorversion!=0] Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_call_sync] [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] [nfs41: return ESERVERFAULT in decode_sequence] [no sr_session, no sr_flags] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: use nfs4_call_sync_sequence to renew session lease] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove nfs4_call_sync_sequence forward definition] Signed-off-by: Andy Adamson <[email protected]> [nfs41: use struct nfs_client for nfs41_proc_async_sequence] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] Signed-off-by: Benny Halevy <[email protected]> [nfs41 nfs41_sequence_call_done update error checking] [nfs41 nfs41_sequence_done update error checking] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove switch on error from nfs41_sequence_call_done] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: enable nfs_client only nfs4_async_handle_errorAndy Adamson1-4/+9
The session is per struct nfs_client, not per nfs_server. Allow the handler to be called with no nfs_server which simplifies the nfs4_proc_async_sequence session renewal call and will let it be used by pnfs file layout data servers. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>