]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/fat/: add support for DOS 1.x formatted volumes
authorConrad Meyer <cse.cem@gmail.com>
Thu, 22 May 2014 00:44:00 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:00 +0000 (10:44 +1000)
commitf4c349a313a91f625da1215eab6cde50204b6f0d
tree250cef822c919c8cbaea70cf65de02994cec83fc
parent3206f722025a628770a81c1e11c84614244428b2
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

Signed-off-by: Conrad Meyer <cse.cem@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/filesystems/vfat.txt
fs/fat/fat.h
fs/fat/inode.c