NFSv4: don't mark all open state for recovery when handling recallable state revoked...
authorScott Mayhew <smayhew@redhat.com>
Mon, 6 May 2019 15:59:05 +0000 (11:59 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 9 May 2019 20:26:57 +0000 (16:26 -0400)
Only delegations and layouts can be recalled, so it shouldn't be
necessary to recover all opens when handling the status bit
SEQ4_STATUS_RECALLABLE_STATE_REVOKED.  We'll still wind up calling
nfs41_open_expired() when a TEST_STATEID returns NFS4ERR_DELEG_REVOKED.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/delegation.c
fs/nfs/delegation.h
fs/nfs/nfs4state.c

index 2f6b447cdd8256c393fcf1cc4580a7174e8a3055..8b78274e3e56fb0e8973e1a5121348d8dbd632a2 100644 (file)
@@ -1033,6 +1033,18 @@ void nfs_mark_test_expired_all_delegations(struct nfs_client *clp)
        rcu_read_unlock();
 }
 
+/**
+ * nfs_test_expired_all_delegations - test all delegations for a client
+ * @clp: nfs_client to process
+ *
+ * Helper for handling "recallable state revoked" status from server.
+ */
+void nfs_test_expired_all_delegations(struct nfs_client *clp)
+{
+       nfs_mark_test_expired_all_delegations(clp);
+       nfs4_schedule_state_manager(clp);
+}
+
 /**
  * nfs_reap_expired_delegations - reap expired delegations
  * @clp: nfs_client to process
index 35b4b02c1ae01d04478b4f4de56c5f59b3ebc911..5799777df5ec860d8eaee84d2ca495b31ea31d09 100644 (file)
@@ -58,6 +58,7 @@ void nfs_delegation_mark_reclaim(struct nfs_client *clp);
 void nfs_delegation_reap_unclaimed(struct nfs_client *clp);
 
 void nfs_mark_test_expired_all_delegations(struct nfs_client *clp);
+void nfs_test_expired_all_delegations(struct nfs_client *clp);
 void nfs_reap_expired_delegations(struct nfs_client *clp);
 
 /* NFSv4 delegation-related procedures */
index f502f1c054cf7645d7b3d27082c180d5b7c067d8..e2e3c4f04d3e097fb411205283048258525be00d 100644 (file)
@@ -2350,8 +2350,7 @@ static void nfs41_handle_recallable_state_revoked(struct nfs_client *clp)
 {
        /* FIXME: For now, we destroy all layouts. */
        pnfs_destroy_all_layouts(clp);
-       /* FIXME: For now, we test all delegations+open state+locks. */
-       nfs41_handle_some_state_revoked(clp);
+       nfs_test_expired_all_delegations(clp);
        dprintk("%s: Recallable state revoked on server %s!\n", __func__,
                        clp->cl_hostname);
 }