aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 885363ca8569..2f6b447cdd82 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -229,6 +229,8 @@ static struct inode *nfs_delegation_grab_inode(struct nfs_delegation *delegation
229 spin_lock(&delegation->lock); 229 spin_lock(&delegation->lock);
230 if (delegation->inode != NULL) 230 if (delegation->inode != NULL)
231 inode = igrab(delegation->inode); 231 inode = igrab(delegation->inode);
232 if (!inode)
233 set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags);
232 spin_unlock(&delegation->lock); 234 spin_unlock(&delegation->lock);
233 return inode; 235 return inode;
234} 236}
@@ -681,7 +683,7 @@ void nfs_expire_all_delegations(struct nfs_client *clp)
681 683
682/** 684/**
683 * nfs_super_return_all_delegations - return delegations for one superblock 685 * nfs_super_return_all_delegations - return delegations for one superblock
684 * @sb: sb to process 686 * @server: pointer to nfs_server to process
685 * 687 *
686 */ 688 */
687void nfs_server_return_all_delegations(struct nfs_server *server) 689void nfs_server_return_all_delegations(struct nfs_server *server)
@@ -944,10 +946,11 @@ restart:
944 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { 946 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
945 list_for_each_entry_rcu(delegation, &server->delegations, 947 list_for_each_entry_rcu(delegation, &server->delegations,
946 super_list) { 948 super_list) {
947 if (test_bit(NFS_DELEGATION_RETURNING, 949 if (test_bit(NFS_DELEGATION_INODE_FREEING,
948 &delegation->flags)) 950 &delegation->flags) ||
949 continue; 951 test_bit(NFS_DELEGATION_RETURNING,
950 if (test_bit(NFS_DELEGATION_NEED_RECLAIM, 952 &delegation->flags) ||
953 test_bit(NFS_DELEGATION_NEED_RECLAIM,
951 &delegation->flags) == 0) 954 &delegation->flags) == 0)
952 continue; 955 continue;
953 if (!nfs_sb_active(server->super)) 956 if (!nfs_sb_active(server->super))
@@ -1053,10 +1056,11 @@ restart:
1053 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { 1056 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
1054 list_for_each_entry_rcu(delegation, &server->delegations, 1057 list_for_each_entry_rcu(delegation, &server->delegations,
1055 super_list) { 1058 super_list) {
1056 if (test_bit(NFS_DELEGATION_RETURNING, 1059 if (test_bit(NFS_DELEGATION_INODE_FREEING,
1057 &delegation->flags)) 1060 &delegation->flags) ||
1058 continue; 1061 test_bit(NFS_DELEGATION_RETURNING,
1059 if (test_bit(NFS_DELEGATION_TEST_EXPIRED, 1062 &delegation->flags) ||
1063 test_bit(NFS_DELEGATION_TEST_EXPIRED,
1060 &delegation->flags) == 0) 1064 &delegation->flags) == 0)
1061 continue; 1065 continue;
1062 if (!nfs_sb_active(server->super)) 1066 if (!nfs_sb_active(server->super))