Revert "NFS: Avoid unnecessary rescanning of the per-server delegation list"

This reverts commit bf7d380b4c.
This commit is contained in:
Ksawlii 2024-11-24 00:23:35 +01:00
parent 911600bccd
commit e4328eacde

View file

@ -609,9 +609,6 @@ restart:
prev = delegation;
continue;
}
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL)
continue;
if (prev) {
struct inode *tmp = nfs_delegation_grab_inode(prev);
@ -622,6 +619,12 @@ restart:
}
}
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL) {
rcu_read_unlock();
iput(to_put);
goto restart;
}
delegation = nfs_start_delegation_return_locked(NFS_I(inode));
rcu_read_unlock();
@ -1142,6 +1145,7 @@ static int nfs_server_reap_unclaimed_delegations(struct nfs_server *server,
struct inode *inode;
restart:
rcu_read_lock();
restart_locked:
list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
if (test_bit(NFS_DELEGATION_INODE_FREEING,
&delegation->flags) ||
@ -1152,7 +1156,7 @@ restart:
continue;
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL)
continue;
goto restart_locked;
delegation = nfs_start_delegation_return_locked(NFS_I(inode));
rcu_read_unlock();
if (delegation != NULL) {
@ -1273,6 +1277,7 @@ static int nfs_server_reap_expired_delegations(struct nfs_server *server,
nfs4_stateid stateid;
restart:
rcu_read_lock();
restart_locked:
list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
if (test_bit(NFS_DELEGATION_INODE_FREEING,
&delegation->flags) ||
@ -1283,7 +1288,7 @@ restart:
continue;
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL)
continue;
goto restart_locked;
spin_lock(&delegation->lock);
cred = get_cred_rcu(delegation->cred);
nfs4_stateid_copy(&stateid, &delegation->stateid);