From f491d6015fbee92db80ffca4f5832a4b3d6359bd Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 27 Jan 2016 13:59:48 -0800 Subject: [PATCH] sys: FspVolumeTransact(): do not retry IRP completions immediately --- src/sys/volume.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/sys/volume.c b/src/sys/volume.c index 6977a808..fd12cc3c 100644 --- a/src/sys/volume.c +++ b/src/sys/volume.c @@ -521,6 +521,7 @@ NTSTATUS FspVolumeTransact( LARGE_INTEGER Timeout; /* process any user-mode file system responses */ + RepostedIrp = 0; Response = SystemBuffer; BufferEnd = (PUINT8)SystemBuffer + InputBufferLength; for (;;) @@ -534,13 +535,21 @@ NTSTATUS FspVolumeTransact( /* either IRP was canceled or a bogus Hint was provided */ continue; - FspIopDispatchComplete(ProcessIrp, Response); + Result = FspIopDispatchComplete(ProcessIrp, Response); + if (STATUS_PENDING == Result) + { + /* + * The IRP has been reposted to our Ioq. Remember the first such IRP, + * so that we know to break the loop if we see it again. + */ + if (0 == RepostedIrp) + RepostedIrp = ProcessIrp; + } Response = NextResponse; } /* process any retried IRP's */ - RepostedIrp = 0; for (;;) { /* get the next retried IRP, but do not go beyond the first reposted IRP! */