Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] NFSv4: don't mark all open state for recovery when handling recallable state revoked flag
@ 2019-05-06 15:59 Scott Mayhew
  2019-05-06 16:36 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Mayhew @ 2019-05-06 15:59 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

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>
---
 fs/nfs/delegation.c | 12 ++++++++++++
 fs/nfs/delegation.h |  1 +
 fs/nfs/nfs4state.c  |  3 +--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 2f6b447cdd82..8b78274e3e56 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -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
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index 35b4b02c1ae0..5799777df5ec 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -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 */
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 3de36479ed7a..7d0ee5a2aef9 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -2346,8 +2346,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);
 }
-- 
2.17.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] NFSv4: don't mark all open state for recovery when handling recallable state revoked flag
  2019-05-06 15:59 [PATCH v2] NFSv4: don't mark all open state for recovery when handling recallable state revoked flag Scott Mayhew
@ 2019-05-06 16:36 ` Trond Myklebust
  0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2019-05-06 16:36 UTC (permalink / raw)
  To: smayhew, anna.schumaker; +Cc: linux-nfs

On Mon, 2019-05-06 at 11:59 -0400, Scott Mayhew wrote:
> 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>
> ---
>  fs/nfs/delegation.c | 12 ++++++++++++
>  fs/nfs/delegation.h |  1 +
>  fs/nfs/nfs4state.c  |  3 +--
>  3 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
> index 2f6b447cdd82..8b78274e3e56 100644
> --- a/fs/nfs/delegation.c
> +++ b/fs/nfs/delegation.c
> @@ -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
> diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
> index 35b4b02c1ae0..5799777df5ec 100644
> --- a/fs/nfs/delegation.h
> +++ b/fs/nfs/delegation.h
> @@ -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 */
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 3de36479ed7a..7d0ee5a2aef9 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -2346,8 +2346,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);
>  }

Thank you!

Reviewed-by: Trond Myklebust <trond.myklebust@hammerspace.com>

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 15:59 [PATCH v2] NFSv4: don't mark all open state for recovery when handling recallable state revoked flag Scott Mayhew
2019-05-06 16:36 ` Trond Myklebust

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox