16 Dec, 2009

4 commits


09 Dec, 2009

1 commit

  • The NFSv4.1 spec indicates RECLAIM_COMPLETE is to be issued
    whenever a client establishes a new client id, not only after
    detecting the server has rebooted.

    Set the NFS4CLNT_RECLAIM_REBOOT bit after every new client id has
    been established. This enables us to issue RECLAIM_COMPLETE
    during the wrap up of the NFS4CLNT_RECLAIM_REBOOT state.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     

07 Dec, 2009

3 commits

  • The state manager was not marking the stateids as needing to be reclaimed
    after reestablishing the clientid.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • If CREATE_SESSION fails with NFS4ERR_STALE_CLIENTID, don't clear the
    NFS4CLNT_SESSION_DRAINING flag and don't wake RPCs waiting for the
    session to be reestablished. We don't have a session yet, so there
    is no reason to wake other RPCs.

    This avoids sending spurious compounds with bogus sequenceID during
    session and state recovery.

    Signed-off-by: Ricardo Labiaga
    [Trond.Myklebust@netapp.com: cleaned up patch by adding the
    nfs41_begin/end_drain_session() helpers]
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • Move call to get the lease time and the setup of the state
    renewal out of nfs4_create_session so that it can be called
    after clearing the DRAINING flag. We use the getattr RPC
    to obtain the lease time, which requires a sequence slot.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     

06 Dec, 2009

6 commits

  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • We should not assume that nfs41_init_clientid() will always want to
    initialise the session. If it is being called due to a server reboot, then
    we just want to reset the session after re-establishing the clientid.

    Fix this by getting rid of the 'reset' parameter in
    nfs4_proc_create_session(), and instead relying on whether or not the
    session slot table pointer is non-NULL.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • This patch invokes RECLAIM_COMPLETE after the client is done
    reclaiming state.

    There are interpretations of the spec that suggest that
    RECLAIM_COMPLETE should also be issued after a new clientid
    has been obtained from the server and even if there is no
    state to reclaim. This tells the server that the client
    has no state to reclaim even if the client isn't aware the
    server may have rebooted.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • Implements RECLAIM_COMPLETE as an asynchronous RPC.
    NFS4ERR_DELAY is retried, NFS4ERR_DEADSESSION invokes the error handling
    but does not result in a retry, since we don't want to have a lingering
    RECLAIM_COMPLETE call sent in the middle of a possible new state recovery
    cycle. If a session reset occurs, a new wave of reclaim operations will
    follow, containing their own RECLAIM_COMPLETE call. We don't want a
    retry to get on the way of recovery by incorrectly indicating to the
    server that we're done reclaiming state.

    A subsequent patch invokes the functionality.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • Otherwise we have no guarantees that other processes won't start another
    RPC call while we're resetting the session.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • the server can indicate a number of error conditions by setting the
    appropriate bits in the SEQUENCE operation. The client re-establishes
    state with the server when it receives one of those, with the action
    depending on the specific case.

    Signed-off-by: Alexandros Batsakis
    Signed-off-by: Trond Myklebust

    Alexandros Batsakis
     

05 Dec, 2009

5 commits


04 Dec, 2009

6 commits


22 Sep, 2009

1 commit


25 Aug, 2009

1 commit

  • Commit 76db6d9500caeaa774a3e32a997eba30bbdc176b (nfs41: add session setup
    to the state manager) introduces an infinite loop possibility in the NFSv4
    state manager. By first checking nfs4_has_session() before clearing the
    NFS4CLNT_SESSION_SETUP flag, it allows for a situation where someone sets
    that flag, but it never gets cleared, and so the state manager loops.

    In fact commit c3fad1b1aaf850bf692642642ace7cd0d64af0a3 (nfs41: add session
    reset to state manager) causes this to happen every time we get a network
    partition error.

    Signed-off-by: Trond Myklebust
    Tested-by: Daniel J Blueman
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     

22 Jul, 2009

1 commit

  • The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
    be due to the nfs4_lock_state->ls_state field being uninitialised. This
    happens if the call to nfs4_free_lock_state() is triggered at the end of
    nfs4_get_lock_state().

    The fix is to move the initialisation of ls_state into the allocator.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

19 Jun, 2009

1 commit


18 Jun, 2009

11 commits

  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • 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

    Trond Myklebust
     
  • 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
    Signed-off-by: Benny Halevy
    [nfs41: check for session not minorversion]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Benny Halevy
     
  • Stops an infinite loop of EXCHANGE_ID.

    Signed-off-by: Andy Adamson
    [fixed checkpatch warnings]
    Signed-off-by: Benny Halevy

    Andy Adamson
     
  • Unlike SETCLIENTID, EXCHANGE_ID requires a machine credential. Do not search
    for credentials other than the machine credential.

    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • EXCHANGE_ID has different credential requirements than SETCLIENTID.
    Prepare for a separate credential function.

    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • 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
    [removed dprintk]
    Signed-off-by: Benny Halevy
    [nfs41: lease renewal]
    [revamped patch for new nfs4_state_manager design]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • 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
    [nfs41: get cred in exchange_id when cred arg is NULL]
    Signed-off-by: Benny Halevy
    [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
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • [moved nfs4_get_renew_cred related changes to
    "nfs41: introduce get_state_renewal_cred"]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Benny Halevy
     
  • 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
    Signed-off-by: Benny Halevy

    [nfs41: session reset in nfs4_recovery_handle_error]
    Signed-off-by: Andy Adamson
    [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
    Signed-off-by: Benny Halevy
    [move nfs4_proc_destroy_session declaration here]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • 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
    Signed-off-by: Benny Halevy

    [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
    Signed-off-by: Benny Halevy

    [nfs41: rename NFS_CS_SESSION_SETUP to NFS_CS_SESSION_INITING]
    Signed-off-by: Andy Adamson
    [nfs41: set NFS_CL_SESSION_INITING in alloc_session]
    Signed-off-by: Andy Adamson
    [nfs41: move session setup into a function]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    [moved nfs4_proc_create_session declaration here]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson