From 1b88791f6f00559cab0fd46c426e0ff72ef91ef1 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Wed, 20 Oct 2010 17:04:26 -0400 Subject: [PATCH] always make an upcall if the thread placing an upcall was woken up from the sleep, but have not been picked up by the daemon thread from the upcall queue, we would just cancel the upcall. thus nfsd would never see it. however, it was causing leaks in the open state. we would allocate open state but matching close would never make it to the daemon. instead, always place an upcall to the daemon, but mark it that nobody is waiting for it if the requesting thread gets interrupted and goes away. --- sys/nfs41_driver.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index 79f1c41..f9c3ea6 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -1254,18 +1254,11 @@ process_upcall: entry = (nfs41_updowncall_entry *)CONTAINING_RECORD(pEntry, nfs41_updowncall_entry, next); ExAcquireFastMutex(&entry->lock); - if (entry->state == NFS41_WAITING_FOR_UPCALL) { - nfs41_AddEntry(downcallLock, downcall, entry); - status = handle_upcall(RxContext, entry, &len); - if (status == STATUS_SUCCESS) - entry->state = NFS41_WAITING_FOR_DOWNCALL; - } else if (entry->state == NFS41_NOT_WAITING) { - DbgP("[upcall] Canceling %s upcall entry %p xid %d\n", - opcode2string(entry->opcode), entry, entry->xid); - ExReleaseFastMutex(&entry->lock); - RxFreePool(entry); - goto process_upcall; - } + nfs41_AddEntry(downcallLock, downcall, entry); + status = handle_upcall(RxContext, entry, &len); + if (status == STATUS_SUCCESS && + entry->state == NFS41_WAITING_FOR_UPCALL) + entry->state = NFS41_WAITING_FOR_DOWNCALL; ExReleaseFastMutex(&entry->lock); if (status == STATUS_INSUFFICIENT_RESOURCES) { DbgP("upcall buffer is too small\n");