summaryrefslogtreecommitdiffstats
path: root/fs/fat/fat.h
diff options
context:
space:
mode:
authorOleksij Rempel <bug-track@fisher-privat.net>2013-02-27 17:03:09 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 19:10:11 -0800
commitb88a105802e9aeb6e234e8106659f5d1271081bb (patch)
tree589342d16e494deeb20da933fe409088e59b04d8 /fs/fat/fat.h
parent6b46419b0462ae565880f02e9cd0baf9b25ea71f (diff)
downloadlinux-b88a105802e9aeb6e234e8106659f5d1271081bb.tar.gz
linux-b88a105802e9aeb6e234e8106659f5d1271081bb.tar.bz2
linux-b88a105802e9aeb6e234e8106659f5d1271081bb.zip
fat: mark fs as dirty on mount and clean on umount
There is no documented methods to mark FAT as dirty. Unofficially MS started to use reserved Byte in boot sector for this purpose, at least since Win 2000. With Win 7 user is warned if fs is dirty and asked to clean it. Different versions of Win, handle it in different ways, but always have same meaning: - Win 2000 and XP, set it on write operations and remove it after operation was finnished - Win 7, set dirty flag on first write and remove it on umount. We will do it as follows: - set dirty flag on mount. If fs was initially dirty, warn user, remember it and do not do any changes to boot sector. - clean it on umount. If fs was initially dirty, leave it dirty. - do not do any thing if fs mounted read-only. - TODO: leave fs dirty if we found some error after mount. Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat/fat.h')
-rw-r--r--fs/fat/fat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 12701a567752..e9cc3f0d58e2 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -95,6 +95,8 @@ struct msdos_sb_info {
spinlock_t dir_hash_lock;
struct hlist_head dir_hashtable[FAT_HASH_SIZE];
+
+ unsigned int dirty; /* fs state before mount */
};
#define FAT_CACHE_VALID 0 /* special case for valid cache */