21 Sep, 2015

1 commit

  • When a read delegation is being recalled, and we're reclaiming the
    cached opens, we need to make sure that we only reclaim read-only
    modes.
    A previous attempt to do this, relied on retrieving the delegation
    type from the nfs4_opendata structure. Unfortunately, as Kinglong
    pointed out, this field can only be set when performing reboot recovery.

    Furthermore, if we call nfs4_open_recover(), then we end up clobbering
    the state->flags for all modes that we're not recovering...

    The fix is to have the delegation recall code pass this information
    to the recovery call, and then refactor the recovery code so that
    nfs4_open_delegation_recall() does not need to call nfs4_open_recover().

    Reported-by: Kinglong Mee
    Fixes: 39f897fdbd46 ("NFSv4: When returning a delegation, don't...")
    Tested-by: Kinglong Mee
    Cc: NeilBrown
    Cc: stable@vger.kernel.org # v4.2+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 Sep, 2015

2 commits


13 Nov, 2014

1 commit

  • Any attempt to call nfs_remove_bad_delegation() while a delegation is being
    returned is currently a no-op. This means that we can end up looping
    forever in nfs_end_delegation_return() if something causes the delegation
    to be revoked.
    This patch adds a mechanism whereby the state recovery code can communicate
    to the delegation return code that the delegation is no longer valid and
    that it should not be used when reclaiming state.
    It also changes the return value for nfs4_handle_delegation_recall_error()
    to ensure that nfs_end_delegation_return() does not reattempt the lock
    reclaim before state recovery is done.

    http://lkml.kernel.org/r/CAN-5tyHwG=Cn2Q9KsHWadewjpTTy_K26ee+UnSvHvG4192p-Xw@mail.gmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

13 Jul, 2014

1 commit


06 Apr, 2013

3 commits


12 Feb, 2013

1 commit

  • If the server reboots while we are converting a delegation into
    OPEN/LOCK stateids as part of a delegation return, the current code
    will simply exit with an error. This causes us to lose both
    delegation state and locking state (i.e. locking atomicity).

    Deal with this by exposing the delegation stateid during delegation
    return, so that we can recover the delegation, and then resume
    open/lock recovery.

    Note that not having to hold the nfs_inode->rwsem across the
    calls to nfs_delegation_claim_opens() also fixes a deadlock against
    the NFSv4.1 reboot recovery code.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

31 Jul, 2012

1 commit

  • This patch exports symbols needed by the v4 module. In addition, I also
    switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
    CONFIG_NFS_V4_MODULE are set.

    The module (nfs4.ko) will be created in the same directory as nfs.ko and
    will be automatically loaded the first time you try to mount over NFS v4.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     

29 Jun, 2012

3 commits


09 May, 2012

1 commit


11 Mar, 2012

1 commit

  • When the NFSv4.0 server tells us that it can no-longer talk to us
    on the callback channel, we should attempt a new SETCLIENTID in
    order to re-transmit the callback channel information.

    Note that as long as we do not change the boot verifier, this is
    a safe procedure; the server is required to keep our state.

    Also move the function nfs_handle_cb_pathdown to fs/nfs/nfs4state.c,
    and change the name in order to mark it as being specific to NFSv4.0.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

09 Mar, 2012

1 commit


06 Mar, 2012

1 commit

  • If we know that the delegation stateid is bad or revoked, we need to
    remove that delegation as soon as possible, and then mark all the
    stateids that relied on that delegation for recovery. We cannot use
    the delegation as part of the recovery process.

    Also note that NFSv4.1 uses a different error code (NFS4ERR_DELEG_REVOKED)
    to indicate that the delegation was revoked.

    Finally, ensure that setlk() and setattr() can both recover safely from
    a revoked delegation.

    Signed-off-by: Trond Myklebust
    Cc: stable@vger.kernel.org

    Trond Myklebust
     

07 Jan, 2011

1 commit

  • Delegations are per-inode, not per-nfs_client. When a server file
    system is migrated, delegations on the client must be moved from the
    source to the destination nfs_server. Make it easier to manage a
    mount point's delegation list across a migration event by moving the
    list to the nfs_server struct.

    Clean up: I added documenting comments to public functions I changed
    in this patch. For consistency I added comments to all the other
    public functions in fs/nfs/delegation.c.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

23 Jun, 2010

1 commit


11 Mar, 2010

1 commit


06 Dec, 2009

2 commits


03 Dec, 2009

1 commit

  • The nfsv4 state manager could potentially deadlock inside
    __nfs_inode_return_delegation() if the server reboots, so that the calls to
    nfs_msync_inode() end up waiting on state recovery to complete.

    Also ensure that if a server reboot or network partition causes us to have
    to stop returning delegations, that NFS4CLNT_DELEGRETURN is set so that
    the state manager can resume any outstanding delegation returns after it
    has dealt with the state recovery situation.

    Finally, ensure that the state manager doesn't wait for the DELEGRETURN
    call to complete. It doesn't need to, and that too can cause a deadlock.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

24 Dec, 2008

6 commits


30 Jan, 2008

1 commit


11 Jul, 2007

4 commits


23 Sep, 2006

1 commit


21 Mar, 2006

1 commit


07 Jan, 2006

2 commits


05 Nov, 2005

1 commit


19 Oct, 2005

1 commit