Revert "nfsd: fix delegation_blocked() to block correctly for at least 30 seconds"

This reverts commit 2f271f8591.
This commit is contained in:
Ksawlii 2024-11-24 00:23:02 +01:00
parent ab71c81dd8
commit 9378ee00ac

View file

@ -1090,8 +1090,7 @@ static void nfs4_free_deleg(struct nfs4_stid *stid)
* When a delegation is recalled, the filehandle is stored in the "new" * When a delegation is recalled, the filehandle is stored in the "new"
* filter. * filter.
* Every 30 seconds we swap the filters and clear the "new" one, * Every 30 seconds we swap the filters and clear the "new" one,
* unless both are empty of course. This results in delegations for a * unless both are empty of course.
* given filehandle being blocked for between 30 and 60 seconds.
* *
* Each filter is 256 bits. We hash the filehandle to 32bit and use the * Each filter is 256 bits. We hash the filehandle to 32bit and use the
* low 3 bytes as hash-table indices. * low 3 bytes as hash-table indices.
@ -1120,9 +1119,9 @@ static int delegation_blocked(struct knfsd_fh *fh)
if (ktime_get_seconds() - bd->swap_time > 30) { if (ktime_get_seconds() - bd->swap_time > 30) {
bd->entries -= bd->old_entries; bd->entries -= bd->old_entries;
bd->old_entries = bd->entries; bd->old_entries = bd->entries;
bd->new = 1-bd->new;
memset(bd->set[bd->new], 0, memset(bd->set[bd->new], 0,
sizeof(bd->set[0])); sizeof(bd->set[0]));
bd->new = 1-bd->new;
bd->swap_time = ktime_get_seconds(); bd->swap_time = ktime_get_seconds();
} }
spin_unlock(&blocked_delegations_lock); spin_unlock(&blocked_delegations_lock);