[VFATLIB] Only check volume if full scan or if allowed to fix it

This allows doing a quick probe about whether a volume needs to be
fixed by checking its dirty bit.

CORE-14692
This commit is contained in:
Pierre Schweitzer 2018-06-05 19:30:11 +02:00
parent 695547cd8c
commit 54f383d996
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -428,6 +428,14 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
/* No need to check FS */
return (fs_close(FALSE) == 0 ? STATUS_SUCCESS : STATUS_DISK_CORRUPT_ERROR);
}
else if (CheckOnlyIfDirty && fs_isdirty())
{
if (!(FsCheckFlags & FSCHECK_READ_WRITE) && !(FsCheckFlags & FSCHECK_INTERACTIVE))
{
fs_close(FALSE);
return STATUS_DISK_CORRUPT_ERROR;
}
}
read_boot(&fs);