mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
[VFATLIB]
Fix a really bad bug in VfatChkdsk(), the routine used to check a volume: In case readwrite is enabled (ie, volume fixing is allowed), when the volume is opened, it is also locked. If the volume has the clean shutdown bit and is to be checked only if that one is not set, then the volume lock is leaked. This makes the volume then totally unusable later on (any later open will fail). Because r75772 fixed volume locking on non-system partition, this totally broke (access denied) any secondary FAT volume in ROS. Now, we just properly release the lock when required, also made a comment more explicit to avoid later bugs like that. CORE-13805 svn path=/trunk/; revision=75911
This commit is contained in:
parent
84fd9647d3
commit
2ac2acf2d7
1 changed files with 5 additions and 1 deletions
|
@ -402,11 +402,15 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
|
|||
verify = TRUE;
|
||||
salvage_files = TRUE;
|
||||
|
||||
/* Open filesystem */
|
||||
/* Open filesystem and lock it */
|
||||
fs_open(DriveRoot, FsCheckFlags & FSCHECK_READ_WRITE);
|
||||
|
||||
if (CheckOnlyIfDirty && !fs_isdirty())
|
||||
{
|
||||
/* Unlock volume if required */
|
||||
if (FsCheckFlags & FSCHECK_READ_WRITE)
|
||||
fs_lock(FALSE);
|
||||
|
||||
/* No need to check FS */
|
||||
return (fs_close(FALSE) == 0 ? STATUS_SUCCESS : STATUS_DISK_CORRUPT_ERROR);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue