
On Tue, Jul 12, 2022 at 10:33:11PM +0000, Heinrich Schuchardt wrote:
Currently we have two functions with redundant coding to find an empty cluster:
- find_empty_cluster() seeks from the beginning of the FAT table
- determine_fatent() seeks after a given entry
Both do not detect the end of the FAT table correctly and return an invalid cluster number if no empty entry if found.
Correctly determine empty FAT entries and full disk correctly.
I hope that you add a test for this specific corner case.
Thanks, -Takahiro Akashi
Carve out a function for creating directory entries to avoid code duplication.
Heinrich Schuchardt (3): fs: fat: finding an empty FAT cluster fs: fat: determine_fatent() error handling fs: fat: carve out fat_create_dir_entry()
fs/fat/fat_write.c | 161 ++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 82 deletions(-)
-- 2.30.2