Conrad Meyer 190a8843de 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>
2014-06-06 16:08:10 -07:00
..
2012-01-03 22:54:57 -05:00
2014-02-10 16:01:40 -08:00
2014-01-24 10:55:21 -06:00
2014-02-10 16:01:40 -08:00
2009-08-19 10:40:13 -07:00
2014-01-28 13:20:20 -08:00
2012-05-10 11:45:31 +01:00
2011-11-04 12:01:48 -07:00
2011-09-27 18:08:04 +02:00
2010-05-10 11:56:30 +02:00
2008-07-26 12:00:05 -07:00
2011-03-31 11:26:23 -03:00
2013-07-25 12:34:15 +02:00
2014-05-05 15:32:05 +02:00
2006-11-30 04:58:40 +01:00
2006-12-07 08:39:44 -08:00
2007-02-12 09:48:40 -08:00
2008-11-12 17:17:17 -08:00