Commit graph

228 commits

Author SHA1 Message Date
Joachim Henze e3ebe9f583 [0.4.11][NTFS] PrintAllVCNs(): Fix a typo in an ASSERT() (#4682), DPRINT1->DPRINT, EOL-WS
First part with the typo in the assert was introduced by 5579428b4f
which was merged into ros by a merge-task during 0.4.8-dev'ing.
releases/0.4.7 didn't have that code yet.
fix picked from 0.4.15-dev-5035-g f308c6a2bc
----------
[NTFS] Do not print debug message for every function call by default
That 2nd part was picked from 0.4.13-dev-450-g 1552434940
----------
And for all the files that I had to touch for the 2nd part in the older branches,
I ported back also some EOL-whitespace-fixes within like they were done during 0.4.15-dev'ing.
2022-10-16 23:30:56 +02:00
Joachim Henze 571b8129bd [0.4.11][UDFS] Fix crash on boot in release builds with UDFS removable media inserted (#4061) CORE-17598
Changes to specific files and their effects are as follows:
create.cpp - Allows booting past second stage with UDFS media inserted without BSOD
close.cpp - Allows shutdown without hang
dircntrl.cpp - Allows New Hardware Wizard not to hang on initial third phase install

It began to crash with the introduction of the UDFS driver in SVN r74901 == git 3a104c8f20

Fix picked from 0.4.15-dev-3326-g a91f5e8e4d
2021-11-14 21:21:05 +01:00
Joachim Henze ede86ddc2f [0.4.11][CDFS] Fix a macro-copy-paste and shrink the binary size CORE-17405
picked from 0.4.15-dev-1456-g 889eab7
2021-07-03 20:46:07 +02:00
Joachim Henze d126fc06da [0.4.11][EXT2] Fix filesystem corruption regressions CORE-17572 CORE-17195
It regressed when we upgraded Ext2Fsd to version 0.69 from version 0.68
via CORE-13980 in 0.4.8-dev-117-g a1d7e9936d

The fix is a partial revert of that.
Thanks to the patches author Doug Lyons.

VBox https://reactos.org/testman/compare.php?ids=77904,77908 LGTM
KVM https://reactos.org/testman/compare.php?ids=77903,77907 LGTM

fix picked from 0.4.15-dev-2792-g cb408102cc
2021-07-02 13:44:19 +02:00
Joachim Henze b7ef9fbb84 [0.4.11][FFS] Silence some only-informative KdPrints.
picked from 0.4.13-dev-924-g 4016225269
2020-12-21 07:52:20 +01:00
Joachim Henze b27a643d26 [0.4.11] [CDFS] Addendum to last commit CORE-15659
#endif placed wrong.
Thx Pierre Schweitzer, Thomas Faber, Serge Gautherie

cherry picked from commit 0.4.12-dev-432-g
3463b2db9f
2019-01-22 19:25:19 +01:00
Joachim Henze 3a2220c43a [0.4.11] [CDFS] Make windows gcc release build compile, regression CORE-15659
Many thanks to Thomas Faber, Pierre Schweitzer, Serge Gautherie

cherry picked from commit 0.4.12-dev-431-g
bccad87f3c
2019-01-22 19:02:39 +01:00
Pierre Schweitzer f4d29a74aa
[NTFS] Don't perform overzealous checks on bitmap while reading a directory
This avoids partial direactory reads where we believe they are corrupted
while they are not.
2018-12-01 21:52:55 +01:00
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
Pierre Schweitzer 4b4c0aabcd
[FASTFAT] Properly return failure in vfatFindDirSpace()
CID 1441394
2018-11-16 22:07:07 +01:00
Mark Harmstone 5729380349
[BTRFS] Import BTRFS upstream commit e43183a0 "open_file: set granted_access when creating file".
Better solution for the original problem described at:
https://github.com/maharmstone/btrfs/pull/123
2018-11-11 21:47:29 +01:00
Hermès Bélusca-Maïto 8c0c90112e
[FASTFAT] Don't mess my debug log when partition SysType is printed! (when invalid chars are printed) 2018-10-13 19:57:24 +02:00
Thomas Faber c7af85b64b
[BTRFS] Fix IRP leak.
This leaked at least one IRP for every write, making it the largest leak when
running with BTRFS as the system volume.
Thanks to Victor Perevertkin.

Submitted upstream thanks to Pierre:
https://github.com/maharmstone/btrfs/pull/106
2018-09-30 16:11:42 +02:00
Pierre Schweitzer 257923cad1
[NPFS] Magic--; 2018-09-30 10:55:44 +02:00
Pierre Schweitzer 6d7ec8c7ec
[CDFS] Revert 9d0596a
The appropriate fix was the previous one, where the macro
for checking legal chars have been fixed.

Thanks to MS for their review :-).

CORE-14067
2018-08-29 08:34:30 +02:00
Pierre Schweitzer 9d0596afe1
[CDFS] Properly check for legal names in CdIsLegalName()
Up to now, it was working by chance. Indeed, due to the invalid
ASCII check performed before calling FsRtlIsAnsiCharacterLegalHpfs(), the
macro is improperly called and overruns the FsRtlLegalAnsiCharacterArray
buffer. Fortunately, up to now, right after that buffer in kernel binary
there are strings which are more or less consistent with the flags that
are expected by the macro, causing a decent behavior of
FsRtlIsAnsiCharacterLegalHpfs() even for extended ASCII characters
(whereas FsRtlIsAnsiCharacterLegalHpfs() is only designed for ASCII
characters). But this is a totally out of control and wrong behavior.
A single change in the way the kernel was built could have caused the
CDFS driver not to work as previously.

I have made the choice to allow any extended ASCII character as done
for the unicode characters. This is a good compromise to avoid drastic
regressions for users having extended ASCII characters in their CD
file names.

This imports proposed upstream commit 1b6b625641dffb49951e60398e1a9c672318ea71
See pull request https://github.com/Microsoft/Windows-driver-samples/pull/278

CORE-14067
2018-08-28 07:50:58 +02:00
Pierre Schweitzer c15c61275c
Addendum to 45fd48b 2018-08-21 12:41:50 +02:00
Pierre Schweitzer 45fd48bd0f
[CDFS_NEW] -> [CDFS] No old driver, thus no new driver 2018-08-21 12:32:15 +02:00
Pierre Schweitzer 5795254933
[CDFS] Delete the old CDFS driver.
You served us well!
2018-08-21 12:27:35 +02:00
Pierre Schweitzer b5aa79a66d
[FASTFAT] Drop an useless #ifdef, we have this cast in all other FSDs 2018-08-21 08:50:29 +02:00
Pierre Schweitzer 4bb1baa860
[FASTFAT] Finally drop the TAG_VFAT allocation tag 2018-08-21 08:36:51 +02:00
Mark Jansen 6c75215bb3 [BTRFS] Fix booting with runtime checks 2018-08-21 07:05:40 +02:00
Pierre Schweitzer 53985bf64d
[FASTFAT] Disable delayed close
It brings too many regressions for too little gain.

CORE-14938
CORE-14917
CORE-14826
2018-08-20 19:43:43 +02:00
Victor Perevertkin 0e61b570e7 [BTRFS] Applied upstream pull-requests before they are merged 2018-08-20 08:26:56 +02:00
Victor Perevertkin 07bc92f740 [USETUP][SETUPLIB] Added support for formatting partition in BTRFS and installing ReactOS on it.
Removed code related to EXT2 boot sector for now.
CORE-13769
2018-08-20 08:26:56 +02:00
Pierre Schweitzer 901c47ed14
[FASTFAT] Don't delay any other close once shutdown has started 2018-08-19 09:56:12 +02:00
Pierre Schweitzer 4fe7aafe10
[FASTFAT] Magic values-- 2018-08-19 09:56:12 +02:00
Pierre Schweitzer 047479e0a2
[FASTFAT] Don't leak statistics on dismount 2018-08-18 19:03:30 +02:00
Pierre Schweitzer 639e6d635f
[FASTFAT] Reduce the usage of the generic allocation tag
And use tag compatible with MS FastFAT, to use debug with WinDBG
2018-08-18 19:03:30 +02:00
Pierre Schweitzer 50b00f0fcc
[FASTFAT] Implement delayed close
When we're about to close a file (ie, forget everything about it
and release any associated structure), actually delay it.
This allows keep data fresh in memory for faster reuse in case
it would be required. The effective closing will only happen after some time.

For specific operations, this will produce a real speed up in ReactOS.
For instance, with that patch, Winamp starts within seconds, instead of dozen
of minutes.
In most cases, it will bring ReactOS to performances it had before fixing
the huge leak in FastFAT (commit 94ead99) without leaking the whole FS.

For now, due to regressions, this is only activated for files and not
for directories. Once it gets fixed, it will be enabled for both.

CORE-14826
CORE-14917
2018-08-18 19:03:30 +02:00
Mike Swanson 3c7e9bb332 Remove unnecessary executable bits 2018-08-15 18:29:09 +02:00
Pierre Schweitzer c13ccc92f6
[BTRFS] Leak the root stream file object on mount.
For whatever (unknown) reason yet, this stream file object
seems to be deleted when still in use while installing
ReactOS on BtrFS partition, leading to use after free.

So, quick and dirty hack: leak it to prevent deletion.

CORE-13769
2018-08-15 16:38:56 +02:00
Pierre Schweitzer 80e11516b1
[BTRFS] Allow driver to start at first stage when no hive is present.
Contrary to upstream, we will ignore failure when opening registry
and will keep going.

CORE-13769
2018-08-15 16:35:05 +02:00
Timo Kreuzer 9e066abe2a [DRIVERS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Timo Kreuzer ca9fd861aa [DRIVERS][NTOS][NDK] Use IO_STACK_LOCATION instead of EXTENDED_IO_STACK_LOCATION and remove the latter from NDK 2018-07-01 14:45:21 +02:00
Pierre Schweitzer 52f0f80a83
[FASTFAT] Don't add an extra \, when renaming a file at root.
This fixes failures to rename a file where destination is
the root of a FAT volume.

CORE-10503
2018-06-09 22:17:17 +02:00
Pierre Schweitzer 6aa4beeefb
[FASTFAT] Use the FastFAT mechanism for counting clusters already implemented
This allows us having more accurate statistics regarding available clusters
count. Even though FastFAT and chkdsk still don't agree!

CORE-3877
2018-06-09 18:23:07 +02:00
Pierre Schweitzer 704baed2df
[FASTFAT] Start implementing FAT32 statistics support
Not fully perfect yet, chkdsk still complains.

CORE-3877
2018-06-09 12:36:43 +02:00
Pierre Schweitzer 04640f9264
[FASTFAT] Save the FSINFO sector location 2018-06-09 12:11:43 +02:00
Pierre Schweitzer 01e2877161
[FASTFAT] Properly check for buffer size on dir enumeration.
This avoids improper returns when multiple entries are requested
and, in rare circumstances, entries not being seen by umode.

CORE-14699
2018-06-07 19:34:47 +02:00
Serge Gautherie c1256dda20 [EXT2FS][REISERFS] VSSolution: Actually disable C4189 errors (#540)
Multiple "error C4189: '[...]': local variable is initialized but not referenced".

Thanks to Yuntian Zhang, who hinted at this in CORE-11836.

CORE-11280
2018-06-05 20:16:22 +02:00
Pierre Schweitzer 9f3169b295
[FASTFAT] Lock DirResource on flush in case we're updating entry
CORE-14660
2018-05-28 19:37:56 +02:00
Pierre Schweitzer fc788cf2fd
[FASTFAT] Lock DirResource when modifying an entry on disk.
Likely not optimal, but fixes some races conditions where
the directory is uninit in the middle of the write.
2018-05-26 17:13:08 +02:00
Pierre Schweitzer c7806a6b29
[BTRFS] Upgrade to 1.0.2
CORE-14655
2018-05-26 10:44:36 +02:00
Pierre Schweitzer 47b9db9d02
[FASTFAT] Initialize cache if neded for changing volume label.
CORE-14654
2018-05-26 10:12:55 +02:00
Pierre Schweitzer b4363068d1
[FASTFAT] Properly handle IRPs that can wait and these that cannot.
CORE-14634
2018-05-22 21:30:08 +02:00
Pierre Schweitzer e9e14be661
[FASTFAT] Properly queue pending write IRPs.
Addendum to 30b836b
2018-05-21 10:41:59 +02:00
Pierre Schweitzer 30b836bf3f
[FASTFAT] When extending a file, also lock the DirResource.
This avoids race conditions under high IOs and thus corruption on
the FS, or assertions failures in the kernel.
Easily triggered by building ReactOS on ReactOS ;-).
2018-05-21 10:30:14 +02:00
Pierre Schweitzer a10f6c7a0c
[FASTFAT] Fail if allocating the stream FO fails. 2018-05-20 13:53:43 +02:00
Pierre Schweitzer 7283f3cfd9
[FASTFAT] Addendum to d69f318 2018-05-19 13:46:34 +02:00