]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
fs/fat: Improve error handling
authorKyle Moffett <Kyle.D.Moffett@boeing.com>
Tue, 20 Dec 2011 07:41:13 +0000 (07:41 +0000)
committerWolfgang Denk <wd@denx.de>
Thu, 5 Jan 2012 19:10:37 +0000 (20:10 +0100)
commit46236b1407946aaed319551357703d487f82572e
tree2546a1cb136c09ad8bd3264bb184fa31da4e8839
parent9813b750f32c0056f0a35813b9a9ec0f68b664af
fs/fat: Improve error handling

The FAT filesystem fails silently in inexplicable ways when given a
filesystem with a block-size that does not match the device sector size.
In theory this is not an unsupportable combination but requires a major
rewrite of a lot of the filesystem.  Until that occurs, the filesystem
should detect that scenario and display a helpful error message.

This scenario in particular occurred on a 512-byte blocksize FAT fs
stored in an El-Torito boot volume on a CD-ROM (2048-byte sector size).

Additionally, in many circumstances the ->block_read method will not
return a negative number to indicate an error but instead return 0 to
indicate the number of blocks successfully read (IE: None).

The FAT filesystem should defensively check to ensure that it got all of
the sectors that it asked for when reading.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
fs/fat/fat.c