1
0
mirror of https://github.com/winfsp/winfsp.git synced 2026-06-26 06:18:21 -05:00
Files
winfsp/src/sys
yeonsh 82f59837f6 sys: fix FileRenameResource self-deadlock between notify session and FspVolumeNotifyWork
Under heavy concurrent rename + change-notification load a volume can
deadlock permanently: all renames (exclusive) and opens (shared) on the
volume block, freezing the mount.

FspFileSystemNotifyBegin (FspVolumeNotifyLock) acquires the per-volume
FileRenameResource shared via an owner pointer (&VolumeNotifyCount) and
holds it for the whole Begin/End session. If a rename queues as an
exclusive waiter mid-session, the asynchronous FspVolumeNotifyWork then
re-acquires the same resource shared with ExAcquireResourceSharedLite.
Due to ERESOURCE writer-priority that shared acquire blocks behind the
queued exclusive waiter (the worker thread is not the owner -- the owner
is the &VolumeNotifyCount pointer). But that work item is the one that
must process FspFileSystemNotifyEnd to drop VolumeNotifyCount to 0 and
release the session, so it can never run: the session lock is never
released and the rename waits forever, while VolumeNotifyCount runs away
as Begin keeps incrementing it.

Acquire the rename resource in FspVolumeNotifyWork with
ExAcquireSharedStarveExclusive instead. The enclosing Begin/End session
already holds the resource shared and already defers renames until End,
so granting this redundant shared acquire ahead of the queued exclusive
waiter preserves name-stability semantics while breaking the deadlock. A
real exclusive holder still blocks the starve-exclusive acquire, so
correctness is unchanged.
2026-06-05 22:48:47 +09:00
..
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2025-06-05 16:02:43 +01:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2016-11-10 11:44:26 -08:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2015-11-17 16:07:46 -08:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2021-04-12 17:47:34 -07:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00
2026-03-04 15:54:27 +02:00