aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/fat.h
diff options
context:
space:
mode:
authorConrad Meyer <cse.cem@gmail.com>2014-06-06 17:36:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:10 -0400
commit190a8843ded231638d0e7ae7d8ca6a712472d114 (patch)
tree30e99192bc39f30584197eab47b119478d8dfe37 /fs/fat/fat.h
parenta19189e5535ed8fd191d8989fc39da1637cfa224 (diff)
fs/fat/: add support for DOS 1.x formatted volumes
Add structure for parsed BPB information, struct fat_bios_param_block, and move all of the deserialization and validation logic from fat_fill_super() into fat_read_bpb(). Add a 'dos1xfloppy' mount option to infer DOS 2.x BIOS Parameter Block defaults from block device geometry for ancient floppies and floppy images, as a fall-back from the default BPB parsing logic. When fat_read_bpb() finds an invalid FAT filesystem and dos1xfloppy is set, fall back to fat_read_static_bpb(). fat_read_static_bpb() validates that the entire BPB is zero, and that the floppy has a DOS-style 8086 code bootstrapping header. Then it fills in default BPB values from media size and a table.[0] Media size is assumed to be static for archaic FAT volumes. See also: [1]. Fixes kernel.org bug #42617. [0]: https://en.wikipedia.org/wiki/File_Allocation_Table#Exceptions [1]: http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html [hirofumi@mail.parknet.co.jp: fix missed error code] Signed-off-by: Conrad Meyer <cse.cem@gmail.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Tested-by: Alan Cox <alan@linux.intel.com> 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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 7c31f4bc74a9..e0c4ba39a377 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -52,7 +52,8 @@ struct fat_mount_options {
52 usefree:1, /* Use free_clusters for FAT32 */ 52 usefree:1, /* Use free_clusters for FAT32 */
53 tz_set:1, /* Filesystem timestamps' offset set */ 53 tz_set:1, /* Filesystem timestamps' offset set */
54 rodir:1, /* allow ATTR_RO for directory */ 54 rodir:1, /* allow ATTR_RO for directory */
55 discard:1; /* Issue discard requests on deletions */ 55 discard:1, /* Issue discard requests on deletions */
56 dos1xfloppy:1; /* Assume default BPB for DOS 1.x floppies */
56}; 57};
57 58
58#define FAT_HASH_BITS 8 59#define FAT_HASH_BITS 8