]> git.baikalelectronics.ru Git - kernel.git/commit
exfat: retain 'VolumeFlags' properly
authorTetsuhiro Kohada <kohada.t2@gmail.com>
Fri, 31 Jul 2020 05:58:26 +0000 (14:58 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Tue, 11 Aug 2020 23:31:13 +0000 (08:31 +0900)
commit1ace9c36d09f4c1f727f692937ffae5fd8f60748
tree357bdc1c10e5e03d3c6bd992f6087ccd0f2eaeb8
parentb687e99ab72097320a33fe2a8576ea2e5d4b0caa
exfat: retain 'VolumeFlags' properly

MediaFailure and VolumeDirty should be retained if these are set before
mounting.

In '3.1.13.3 Media Failure Field' of exfat specification describe:

 If, upon mounting a volume, the value of this field is 1,
 implementations which scan the entire volume for media failures and
 record all failures as "bad" clusters in the FAT (or otherwise resolve
 media failures) may clear the value of  this field to 0.

Therefore, We should not clear MediaFailure without scanning volume.

In '8.1 Recommended Write Ordering' of exfat specification describe:

 Clear the value of the VolumeDirty field to 0, if its value prior to
 the first step was 0.

Therefore, We should not clear VolumeDirty after mounting.
Also rename ERR_MEDIUM to MEDIA_FAILURE.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
fs/exfat/exfat_fs.h
fs/exfat/exfat_raw.h
fs/exfat/file.c
fs/exfat/inode.c
fs/exfat/namei.c
fs/exfat/super.c