summaryrefslogtreecommitdiff
path: root/fs/exfat/inode.c
diff options
context:
space:
mode:
authorTetsuhiro Kohada <kohada.t2@gmail.com>2020-07-31 14:58:26 +0900
committerNamjae Jeon <namjae.jeon@samsung.com>2020-08-12 08:31:13 +0900
commit7018ec68f08249de17cb131b324d5a48e89ed898 (patch)
tree357bdc1c10e5e03d3c6bd992f6087ccd0f2eaeb8 /fs/exfat/inode.c
parent4dc7d35e09ba78aa0a3bcaa9fad1c19952e018a7 (diff)
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>
Diffstat (limited to 'fs/exfat/inode.c')
-rw-r--r--fs/exfat/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index f0160a7892a8..7f90204adef5 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -39,7 +39,7 @@ static int __exfat_write_inode(struct inode *inode, int sync)
if (is_dir && ei->dir.dir == sbi->root_dir && ei->entry == -1)
return 0;
- exfat_set_vol_flags(sb, VOL_DIRTY);
+ exfat_set_volume_dirty(sb);
/* get the directory entry of given file or directory */
es = exfat_get_dentry_set(sb, &(ei->dir), ei->entry, ES_ALL_ENTRIES);
@@ -167,7 +167,7 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
}
if (*clu == EXFAT_EOF_CLUSTER) {
- exfat_set_vol_flags(sb, VOL_DIRTY);
+ exfat_set_volume_dirty(sb);
new_clu.dir = (last_clu == EXFAT_EOF_CLUSTER) ?
EXFAT_EOF_CLUSTER : last_clu + 1;