From: short <> Date: Mon, 10 Feb 2003 10:08:15 +0000 (+0000) Subject: IoShutdownRegisteredFileSystems(): Protected against broken filesystems X-Git-Tag: captive-0_2~61 X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=commitdiff_plain;h=a6867fd6393466d8f81573905e44f31234f02a9e IoShutdownRegisteredFileSystems(): Protected against broken filesystems - such as ext2fsd.sys not calling IoUnregisterFileSystem() --- diff --git a/ntoskrnl/io/fs.c b/ntoskrnl/io/fs.c index b96750b..fa340d8 100644 --- a/ntoskrnl/io/fs.c +++ b/ntoskrnl/io/fs.c @@ -180,7 +180,7 @@ IoShutdownRegisteredFileSystems(VOID) { KIRQL oldlvl; PLIST_ENTRY current_entry; - FILE_SYSTEM_OBJECT* current; + FILE_SYSTEM_OBJECT* current,*current_last=NULL; PIRP Irp; KEVENT Event; IO_STATUS_BLOCK IoStatusBlock; @@ -195,10 +195,12 @@ IoShutdownRegisteredFileSystems(VOID) KeInitializeEvent(&Event,NotificationEvent,FALSE); /* 'current' will get IoDeleteDevice()ed by IRP_MJ_SHUTDOWN! */ - /* FIXME: deadlock loop detection */ while ((current_entry = FileSystemListHead.Flink)!=(&FileSystemListHead)) { current = CONTAINING_RECORD(current_entry,FILE_SYSTEM_OBJECT,Entry); + if (current==current_last) + KeBugCheck(0); /* filesystem forgot to call IoUnregisterFileSystem() */ + current_last=current; /* send IRP_MJ_SHUTDOWN */ Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN,