The BackendPath can change as part of PDO state transitions, leading
to a race with the frontend thread. Since the frontend state lock is
locked through state transitions, taking the lock is sufficient to
avoid the race
Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>
__in PXENVBD_FRONTEND Frontend
)
{
+ KIRQL Irql;
+ KeAcquireSpinLock(&Frontend->StateLock, &Irql);
// Only attempt this if Active, Active is set/cleared on D3->D0/D0->D3
if (Frontend->Active) {
// Note: Nothing may have changed with this target, this could be caused by another target changing
__ReadDiskInfo(Frontend);
__CheckBackendForEject(Frontend);
}
+ KeReleaseSpinLock(&Frontend->StateLock, Irql);
}
__checkReturn