From 89cd10a1f93da4490b1b8d2f42d095dffd43d021 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Wed, 15 Dec 2010 16:15:29 -0500 Subject: [PATCH] not allowing unmount if there are opened files even though we might have the same server mounted under 2 drive letters, make it so that you can't umount if any files are opened in that netroot. not checking for that allows us to umount the driver while it is still in use. then there is no way to "unmount" from nfsd's perspective and it'll have that session and connection going forever. passing "false" to RxFinalizeConnection makes it so that when files are opened it won't allow the unmount, but when the files are closed, it will successfully unmount but RDBSS never call FinalizeNetRoot() function and thus we never really unmount. i noticed that FinalizeVNetRoot() is never called. Returns from FinalizeNetRoot() are ignored so we can't fail there if we have opened files. --- sys/nfs41_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index bd7d83b..5e0437f 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -1874,6 +1874,12 @@ NTSTATUS nfs41_DevFcbXXXControlFile( status = nfs41_CreateConnection(RxContext, &RxContext->PostRequest); break; case IOCTL_NFS41_DELCONN: + if (RxContext->RxDeviceObject->NumberOfActiveFcbs > 0) { + DbgP("device has open handles %d\n", + RxContext->RxDeviceObject->NumberOfActiveFcbs); + status = STATUS_REDIRECTOR_HAS_OPEN_HANDLES; + break; + } status = nfs41_DeleteConnection(RxContext, &RxContext->PostRequest); break; case IOCTL_NFS41_GETSTATE: