[VFATLIB] Never touch the file system if not in interactive or RW mode.

It's critical not to perform any write on a volume without an exclusive lock on it.
That lock is only acquired if ChkDsk is started in RW mode.
Also added an assert in write routine, to make sure that when we're about to perform
a write operation, we're really allowed to do so.

This will avoid volume corruptions when a simple "chkdsk" is issued from cmd.
To put it simple: check will really check now, and won't attempt any repair.

CORE-14119
This commit is contained in:
Pierre Schweitzer 2017-12-17 13:59:20 +01:00
parent 284a839dbd
commit b0bf7dfb62
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
3 changed files with 137 additions and 117 deletions

View file

@ -352,6 +352,8 @@ void fs_write(off_t pos, int size, void *data)
CHANGE *new;
int did;
assert(interactive || rw);
#if 1 //SAE
if (FsCheckFlags & FSCHECK_IMMEDIATE_WRITE) {