From 67ae1eddaf82179febe3a08df4f3012d48c9ab42 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Thu, 3 Feb 2011 11:46:51 -0500 Subject: [PATCH] making all but CLOSE interruptable leaving CLOSE upcall non-interruptable as it leads to issues with security context. making all other upcalls interruptable so that when something goes wrong we can ctrl-c out of a user application. otherwise, the machine requires a reboot (ie caz the wait we made the wait non-interrutable so nothing can kill it). --- sys/nfs41_driver.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index d23b6c4..ddc852e 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -1245,7 +1245,26 @@ NTSTATUS nfs41_UpcallWaitForReply( KeSetEvent(&upcallEvent, 0, FALSE); DbgP("@@@ Creating %s upcall entry=%p xid=%d\n", opstring, entry, entry->xid); if (!entry->async_op) { + /* 02/03/2011 AGLO: it is not clear what the "right" waiting design should be. + * Having non-interruptable waiting seems to be the right approach. However, + * when things go wrong, the only wait to proceed is a reboot (since "waits" + * are not interruptable we can't stop a hung task. + * Having interruptable wait causes issues with security context. + * For now, I'm making CLOSE non-interruptable but keeping the rest interruptable + * so that we don't have to reboot all the time + */ +#define MAKE_WAITONCLOSE_NONITERRUPTABLE +#ifdef MAKE_WAITONCLOSE_NONITERRUPTABLE + if (entry->opcode == NFS41_CLOSE) + status = KeWaitForSingleObject(&entry->cond, Executive, + KernelMode, FALSE, NULL); + else + status = KeWaitForSingleObject(&entry->cond, Executive, + UserMode, TRUE, NULL); +#else + status = KeWaitForSingleObject(&entry->cond, Executive, KernelMode, FALSE, NULL); +#endif print_wait_status(1, "[downcall]", status, opcode2string(entry->opcode), entry, entry->xid); } else