https://git.reactos.org/?p=reactos.git;a=commitdiff;h=54f383d9965463bf036f92...
commit 54f383d9965463bf036f92affcda6c44b0dc4ffa Author: Pierre Schweitzer pierre@reactos.org AuthorDate: Tue Jun 5 19:30:11 2018 +0200 Commit: Pierre Schweitzer pierre@reactos.org CommitDate: Tue Jun 5 19:34:47 2018 +0200
[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 --- sdk/lib/fslib/vfatlib/vfatlib.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/sdk/lib/fslib/vfatlib/vfatlib.c b/sdk/lib/fslib/vfatlib/vfatlib.c index 8db6e8a11a..82c1282fbf 100644 --- a/sdk/lib/fslib/vfatlib/vfatlib.c +++ b/sdk/lib/fslib/vfatlib/vfatlib.c @@ -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);