reactos/drivers
Hermès Bélusca-Maïto b77824a375 [FASTFAT] Improvements for volume dismount + minor bugfixing.
- Cache the RootFcb so that its cleanup can be handled separately
  during dismounting.

- Force volume dismount at cleanup if the VCB_DISMOUNT_PENDING flag
  is set.

- Actually dismount a volume if its VCB has been flagged as not good,
  or if we force dismounting.

NOTE: In their *CheckForDismount() function, our 3rd-party FS drivers
as well as MS' fastfat, perform a comparison check of the current VCB's
VPB ReferenceCount with some sort of "dangling"/"residual" open count.
It seems to be related to the fact that the volume root directory as
well as auxiliary data stream(s) are still opened, and only these are
allowed to be opened at that moment. After analysis it appears that for
the ReactOS' fastfat, this number is equal to "3".

- On dismounting, cleanup and destroy the RootFcb, VolumeFcb and the
  FATFileObject. Then cleanup the SpareVPB or the IoVPB members, and
  finish by removing the dismounted volume from the VolumeListEntry
  and cleaning up the notify synchronization object and the resources.

- During dismounting, and on shutdown, flush the volume before
  resetting its dirty bit.

- On shutdown, after volume flushing, try to unmount it without forcing.

- Release the VCB resources only when we actually dismount the volume
  in VfatCheckForDismount().

- Initialize first the notify list and the synchronization object,
  before sending the FSRTL_VOLUME_MOUNT notification.

- If we failed at mounting a volume but its VCB's FATFileObject was
  already initialized, first call CcUninitializeCacheMap() on it
  before dereferencing it.

- Send FSRTL_VOLUME_LOCK, FSRTL_VOLUME_LOCK_FAILED and
  FSRTL_VOLUME_UNLOCK notifications during volume locking (and failure)
  and volume unlocking.

- Flush the volume before locking it, and clean its dirty bit if needed.

NOTE: In addition to checking for VCB_CLEAR_DIRTY, we also check for the
presence of the VCB_IS_DIRTY flag before cleaning up the dirty bit: this
allows us to not re-clean the bit if it has been previously cleaned.
This is needed for instance in this scenario:
- The volume is locked (it gets flushed and the dirty bit is possibly cleared);
- The volume then gets formatted with a completely different FS, that
  possibly clears up the first sector (e.g. BTRFS ignores 1st sector);
- The volume is then dismounted: if we didn't check whether VCB_IS_DIRTY
  was set prior to resetting it, we could attempt clearing it again! But
  now that the volume's filesystem has been completely changed, we would
  then try to modify the dirty bit on an erroneous position on disk!
  That's why it should not be touched in this case during dismounting.
- The volume is unlocked (same comment as above), and later can be
  detected as being BTRFS.
2018-11-25 09:00:40 +01:00
..
base [NULL] Additions for the Null driver. 2018-04-22 22:23:54 +02:00
battery
bluetooth [CMAKE/CLANG-CL] Silence some clang-cl warnings in consistency with our gcc build. 2017-12-07 21:53:45 +01:00
bus [ACPICA] Update to version 20181003. CORE-15222 2018-10-28 15:28:37 +01:00
crypto [REACTOS] Fix x64 build 2017-10-22 16:49:04 +02:00
filesystems [FASTFAT] Improvements for volume dismount + minor bugfixing. 2018-11-25 09:00:40 +01:00
filters [FLTMGR] Remove duplicated export 2018-10-29 23:56:39 +01:00
hid [DRIVERS] Use KeClearEvent instead of KeResetEvent where the previous state is not needed. 2017-12-30 11:44:25 +01:00
input [I8042PRT] Move DMI/SMBIOS parsing functions into library 2018-08-02 21:29:57 +02:00
ksfilter [SWENUM] Add version information. CORE-14112 2017-12-17 02:22:28 +01:00
multimedia Delete "ghost" old(*) files that have been mysteriously added back during the SVN-to-Git transition. 2017-10-04 10:28:36 +02:00
network [TCPIP] Properly display local information for established connections 2018-11-24 22:26:06 +01:00
parallel [DRIVERS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
processor
sac [DRIVERS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
serial [SERIAL] Fix Serial{Get,Clear}PerfStats() to become proper PKSYNCHRONIZE_ROUTINE routines and get rid of the related casts. Brought to you by Thomas Faber. CORE-11799 (#94) 2017-10-31 15:44:39 +01:00
setup [BLUE] Perform size/rectangle boundary checks on read/write operations. CORE-15108 2018-09-29 21:55:00 +02:00
storage [RAMDISK] Implement missing IOCTLs 2018-09-16 11:46:24 +02:00
usb [USBEHCI_NEW] Bring-in the USB EHCI miniport driver created by Vadim Galyant. (#301) 2018-09-10 09:05:35 +02:00
wdm [DRIVERS] Use KeClearEvent instead of KeResetEvent where the previous state is not needed. 2017-12-30 11:44:25 +01:00
wmi
CMakeLists.txt