]> git.baikalelectronics.ru Git - uboot.git/commit
fat: fatwrite: fix the command for FAT12
authorPhilipp Skadorov <philipp.skadorov@savoirfairelinux.com>
Thu, 15 Dec 2016 20:52:53 +0000 (15:52 -0500)
committerTom Rini <trini@konsulko.com>
Tue, 27 Dec 2016 16:24:13 +0000 (11:24 -0500)
commite015c2b31d73922801dd1aefd2a30867268b1706
treecde9103347ae17a2bbae256f1c591f2d366e31e7
parent6ccad2ac40abeeedadefe1b9940f40a2f3ffc0c2
fat: fatwrite: fix the command for FAT12

The u-boot command fatwrite empties FAT clusters from the beginning
till the end of the file.
Specifically for FAT12 it fails to detect the end of the file and goes
beyond the file bounds thus corrupting the file system.

Additionally, FAT entry chaining-up into a file is not implemented
for FAT12.

The users normally workaround this by re-formatting the partition as
FAT16/FAT32, like here:
https://github.com/FEDEVEL/openrex-uboot-v2015.10/issues/1

The patch fixes the bounds of a file and FAT12 entries chaining into
a file, including EOF markup.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
fs/fat/fat_write.c