@ -436,6 +436,8 @@ static bool nfs_delegation_need_return(struct nfs_delegation *delegation)
{
{
bool ret = false ;
bool ret = false ;
if ( test_bit ( NFS_DELEGATION_RETURNING , & delegation - > flags ) )
goto out ;
if ( test_and_clear_bit ( NFS_DELEGATION_RETURN , & delegation - > flags ) )
if ( test_and_clear_bit ( NFS_DELEGATION_RETURN , & delegation - > flags ) )
ret = true ;
ret = true ;
if ( test_and_clear_bit ( NFS_DELEGATION_RETURN_IF_CLOSED , & delegation - > flags ) & & ! ret ) {
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)
ret = true ;
ret = true ;
spin_unlock ( & delegation - > lock ) ;
spin_unlock ( & delegation - > lock ) ;
}
}
out :
return ret ;
return ret ;
}
}
@ -818,6 +821,9 @@ restart:
list_for_each_entry_rcu ( server , & clp - > cl_superblocks , client_link ) {
list_for_each_entry_rcu ( server , & clp - > cl_superblocks , client_link ) {
list_for_each_entry_rcu ( delegation , & server - > delegations ,
list_for_each_entry_rcu ( delegation , & server - > delegations ,
super_list ) {
super_list ) {
if ( test_bit ( NFS_DELEGATION_RETURNING ,
& delegation - > flags ) )
continue ;
if ( test_bit ( NFS_DELEGATION_NEED_RECLAIM ,
if ( test_bit ( NFS_DELEGATION_NEED_RECLAIM ,
& delegation - > flags ) = = 0 )
& delegation - > flags ) = = 0 )
continue ;
continue ;