From 64bc96558e878cc91da148ec5892a7e2bf58e052 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 17 Dec 2017 18:21:51 +0100 Subject: [PATCH] [FASTFAT] While closing FCBs on dismount, release from tail to head and not the contrary. It fixes assertion failure in vfatDestroyFCB() where we would have release parent before child. This is still not perfect, but less bug prone... With this commits (and ENABLE_SWAPOUT defined), ReactOS seems to unmount FAT volumes quite nice! :-) (Tried with fsutil volume dismount X:) --- drivers/filesystems/fastfat/fsctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/filesystems/fastfat/fsctl.c b/drivers/filesystems/fastfat/fsctl.c index f059410044e..abd772648a0 100644 --- a/drivers/filesystems/fastfat/fsctl.c +++ b/drivers/filesystems/fastfat/fsctl.c @@ -1203,7 +1203,7 @@ VfatDismountVolume( /* Rebrowse the FCB in order to free them now */ while (!IsListEmpty(&DeviceExt->FcbListHead)) { - NextEntry = RemoveHeadList(&DeviceExt->FcbListHead); + NextEntry = RemoveTailList(&DeviceExt->FcbListHead); Fcb = CONTAINING_RECORD(NextEntry, VFATFCB, FcbListEntry); vfatDestroyFCB(Fcb); }