diff options
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r-- | fs/nfs/delegation.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index be313e791e67..a6ad68865880 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -436,6 +436,8 @@ static bool nfs_delegation_need_return(struct nfs_delegation *delegation) | |||
436 | { | 436 | { |
437 | bool ret = false; | 437 | bool ret = false; |
438 | 438 | ||
439 | if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) | ||
440 | goto out; | ||
439 | if (test_and_clear_bit(NFS_DELEGATION_RETURN, &delegation->flags)) | 441 | if (test_and_clear_bit(NFS_DELEGATION_RETURN, &delegation->flags)) |
440 | ret = true; | 442 | ret = true; |
441 | if (test_and_clear_bit(NFS_DELEGATION_RETURN_IF_CLOSED, &delegation->flags) && !ret) { | 443 | if (test_and_clear_bit(NFS_DELEGATION_RETURN_IF_CLOSED, &delegation->flags) && !ret) { |
@@ -447,6 +449,7 @@ static bool nfs_delegation_need_return(struct nfs_delegation *delegation) | |||
447 | ret = true; | 449 | ret = true; |
448 | spin_unlock(&delegation->lock); | 450 | spin_unlock(&delegation->lock); |
449 | } | 451 | } |
452 | out: | ||
450 | return ret; | 453 | return ret; |
451 | } | 454 | } |
452 | 455 | ||
@@ -818,6 +821,9 @@ restart: | |||
818 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { | 821 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { |
819 | list_for_each_entry_rcu(delegation, &server->delegations, | 822 | list_for_each_entry_rcu(delegation, &server->delegations, |
820 | super_list) { | 823 | super_list) { |
824 | if (test_bit(NFS_DELEGATION_RETURNING, | ||
825 | &delegation->flags)) | ||
826 | continue; | ||
821 | if (test_bit(NFS_DELEGATION_NEED_RECLAIM, | 827 | if (test_bit(NFS_DELEGATION_NEED_RECLAIM, |
822 | &delegation->flags) == 0) | 828 | &delegation->flags) == 0) |
823 | continue; | 829 | continue; |