
Since long name support was added to U-Boot's implementation of the FAT file system corruption of the directories was observed when running the UEFI Self Certifification Test.
The following problems are addressed by this series.
* short names were not unique * long names directory entries were not deleted when a file was deleted * directory entries released by file deletion were not reused
The first four patches are just resent to indicate the import sequence.
The following problems need to be addressed in further patches:
* When extending a file only available FAT entries after the last cluster of the file are considered. Available FAT entries before are ignored. * The case of no FAT entry found is not treated correctly. * The free FAT count is not updated on FAT32. * Some FAT related tests are not run on Gitlab CI. * Add tests to detect directory corruption.
Heinrich Schuchardt (18): fs: fat: avoid NULL dereference when root dir is full fs: fat: directory entries starting with 0x05 fs: fat: use ATTR_ARCH instead of anonymous 0x20 fs: fat: correct first cluster for '..' fs: fat: export fat_next_cluster() fs: fat: create correct short names fs: fat: pass shortname to fill_dir_slot fs: fat: call set_name() only once fs: fat: generate unique short names fs: fat: dentry iterator for fill_dir_slot() fs: fat: set start cluster for root directory fs: fat: flush new directory cluster fs: fat: fat_find_empty_dentries() fs: fat: reuse deleted directory entries fs: fat: search file should not allocate cluster fs: fat: use constant DELETED_FLAG fs: fat: first dentry of long name in FAT iterator fs: fat: deletion of long file names
fs/fat/fat.c | 133 ++++++++---- fs/fat/fat_write.c | 532 +++++++++++++++++++++++++++++++++------------ include/fat.h | 7 +- lib/Kconfig | 2 +- 4 files changed, 494 insertions(+), 180 deletions(-)
-- 2.29.2