]> git.ipfire.org Git - people/ms/u-boot.git/commit
fs/fat/fat_write: Fix management of empty files
authorBenoît Thébaudeau <benoit@wsystem.com>
Mon, 28 Sep 2015 13:45:32 +0000 (15:45 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 11 Oct 2015 21:12:08 +0000 (17:12 -0400)
commit1254b44a9f31c78ce7325eb392eaa949a2c7fc9a
treec02399fd3ce118719e0f209234747b82509102d3
parente876be4b5ccb661d68b5b83330e134ace339316c
fs/fat/fat_write: Fix management of empty files

Overwriting an empty file not created by U-Boot did not work, and it
could even corrupt the FAT. Moreover, creating empty files or emptying
existing files allocated a cluster, which is not standard.

Fix this by always keeping empty files clusterless as specified by
Microsoft (the start cluster must be set to 0 in the directory entry in
that case), and by supporting overwriting such files.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
fs/fat/fat_write.c