mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 15:41:37 +00:00
[VFATLIB] Make Chkdsk handle volume opening locking failures.
For instance, when repair is required, we can ask the caller whether we should continue or not in case locking failed. Also, introduced a hack for 1st stage where IopParseDevice() hack is in usage so that broken NTSTATUS is diverted to appropriate status. That way, usetup will properly continue even if locking failed (due to its callback stub!) CORE-14087
This commit is contained in:
parent
287d7cd80a
commit
6a224a38a1
3 changed files with 31 additions and 5 deletions
|
@ -383,6 +383,7 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
|
|||
BOOLEAN salvage_files;
|
||||
ULONG free_clusters;
|
||||
DOS_FS fs;
|
||||
NTSTATUS Status;
|
||||
|
||||
RtlZeroMemory(&fs, sizeof(fs));
|
||||
|
||||
|
@ -403,7 +404,20 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
|
|||
salvage_files = TRUE;
|
||||
|
||||
/* Open filesystem and lock it */
|
||||
fs_open(DriveRoot, FsCheckFlags & FSCHECK_READ_WRITE);
|
||||
Status = fs_open(DriveRoot, FsCheckFlags & FSCHECK_READ_WRITE);
|
||||
if (Status == STATUS_ACCESS_DENIED)
|
||||
{
|
||||
/* We failed to lock, ask the caller whether we should continue */
|
||||
if (Callback(VOLUMEINUSE, 0, NULL))
|
||||
{
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
fs_close(FALSE);
|
||||
return STATUS_DISK_CORRUPT_ERROR;
|
||||
}
|
||||
|
||||
if (CheckOnlyIfDirty && !fs_isdirty())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue