- diff --git a/daemon/open.c b/daemon/open.c
- index f605f1e..534d21d 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -84,6 +84,21 @@ static void open_state_free(
- {
- struct list_entry *entry, *tmp;
- + EASSERT(state->ref_count == 0);
- +#ifdef NFS41_DRIVER_STABILITY_HACKS
- + BOOLEAN state_lock_locked;
- +
- + /* Check whether something is still using the lock */
- + state_lock_locked = TryAcquireSRWLockExclusive(&state->lock);
- + if (state_lock_locked)
- + ReleaseSRWLockExclusive(&state->lock);
- + if (state_lock_locked == FALSE) {
- + AcquireSRWLockExclusive(&state->lock);
- + ReleaseSRWLockExclusive(&state->lock);
- + }
- + EASSERT(state_lock_locked != FALSE);
- +#endif /* NFS41_DRIVER_STABILITY_HACKS */
- +
- /* free associated lock state */
- list_for_each_tmp(entry, tmp, &state->locks.list)
- free(list_container(entry, nfs41_lock_state, open_entry));
- @@ -117,6 +132,8 @@ void nfs41_open_state_ref(
- return;
- #endif /* NFS41_DRIVER_STABILITY_HACKS */
- + EASSERT(state->ref_count > 0);
- +
- const LONG count = InterlockedIncrement(&state->ref_count);
- DPRINTF(2, ("nfs41_open_state_ref('%s') count %d\n", state->path.path, count));
- @@ -125,6 +142,8 @@ void nfs41_open_state_ref(
- void nfs41_open_state_deref(
- IN nfs41_open_state *state)
- {
- + EASSERT(state->ref_count > 0);
- +
- const LONG count = InterlockedDecrement(&state->ref_count);
- DPRINTF(2, ("nfs41_open_state_deref('%s') count %d\n", state->path.path, count));
Prototype wait for SRW locks before |free()|
Posted by Anonymous on Wed 28th Feb 2024 09:08
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.