2 Commits
Author SHA1 Message Date
HorusGod 5c01ce9f00 add timeouts to remaining infinite waits in pnp.c and fsctl.c
The previous commit missed three infinite KeWaitForSingleObject calls:

- pnp.c: Ext2PnpRemove and Ext2PnpSurpriseRemove wait forever for the
  lower driver to complete the PnP IRP after device removal
- fsctl.c: Ext2IsMediaWriteProtected waits forever for the
  write-protect check IRP to complete

All three now use 30-second timeouts with IRP cancellation on timeout,
matching the pattern used in block.c.
2026-03-05 00:59:24 +02:00
HorusGod d0f12d766a fix system hang on USB/removable device removal
When a USB drive with an ext4 filesystem is removed while the driver has
outstanding I/O, the system hangs indefinitely because
KeWaitForSingleObject calls block forever waiting for completions that
will never arrive from the removed device.

This commit fixes the issue with three changes:

- block.c: add 30-second timeouts to all KeWaitForSingleObject calls and
  cancel pending IRPs on timeout instead of waiting forever
- pnp.c: set VCB_DEVICE_REMOVED flag early in both PnpRemove and
  PnpSurpriseRemove so concurrent I/O threads can fail fast
- read.c, write.c: check VCB_DEVICE_REMOVED flag before issuing new I/O
  and return STATUS_NO_SUCH_DEVICE immediately
2026-03-04 15:25:59 +02:00