diff --git a/drivers/filters/mountmgr/notify.c b/drivers/filters/mountmgr/notify.c index 8b7c676da2a..97bc9470376 100644 --- a/drivers/filters/mountmgr/notify.c +++ b/drivers/filters/mountmgr/notify.c @@ -247,12 +247,14 @@ MountMgrTargetDeviceNotification(IN PVOID NotificationStructure, */ else if (IsEqualGUID(&(Notification->Event), &GUID_IO_VOLUME_MOUNT)) { + /* If we were already mounted, then mark us unmounted */ if (InterlockedCompareExchange(&(DeviceInformation->MountState), FALSE, - TRUE) == TRUE) + FALSE) == TRUE) { InterlockedDecrement(&(DeviceInformation->MountState)); } + /* Otherwise, start mounting the device and first, reconcile its DB if required */ else { if (DeviceInformation->NeedsReconcile)