X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=ntoskrnl%2Fio%2Ffs.c;h=a241167bebb620986d223fdf800eec3d31dfedc4;hb=83471265bdf87b193f004fde316d03d891eb2d34;hp=b96750b6e8c35396c673d60678b90726a74aa492;hpb=fc9befd570b3a56094989d0d90ae8d39670acb7c;p=reactos.git diff --git a/ntoskrnl/io/fs.c b/ntoskrnl/io/fs.c index b96750b..a241167 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,20 @@ 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) + { + /* At least ntfs.sys-NT5.1sp1 appears to not to unregister itself. + * It does not import symbol IoUnregisterFileSystem() at all! + * BTW also ext2fsd.sys<=v0.10A also forgets to call IoUnregisterFileSystem(). + */ + DPRINT("IoShutdownRegisteredFileSystems(): WARNING: filesystem forgot to call IoUnregisterFileSystem() !!!\n"); + IoUnregisterFileSystem(current->DeviceObject); + continue; + } + current_last=current; /* send IRP_MJ_SHUTDOWN */ Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN,