linux-stable/fs/fat
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
..
cache.c fs/fat: fix two checkpatch issues in cache.c 2012-10-06 03:05:10 +09:00
dir.c [readdir] convert fatfs 2013-06-29 12:57:01 +04:00
fat.h fs/fat/: add support for DOS 1.x formatted volumes 2014-06-06 16:08:10 -07:00
fatent.c fat: no need to reset EOF in ent_put for FAT32 2012-10-06 03:05:12 +09:00
file.c fatfs: add FAT_IOCTL_GET_VOLUME_ID 2013-07-09 10:33:25 -07:00
inode.c fs/fat/: add support for DOS 1.x formatted volumes 2014-06-06 16:08:10 -07:00
Kconfig vfat: Note the NLS requirement 2009-04-17 09:32:11 -07:00
Makefile fat (exportfs): move NFS support code 2012-10-06 03:05:09 +09:00
misc.c fs/fat: use fat_msg() to replace printk() in __fat_fs_error() 2013-07-03 16:08:01 -07:00
namei_msdos.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
namei_vfat.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
nfs.c fat (exportfs): rebuild directory-inode if fat_dget() 2013-04-29 18:28:41 -07:00