public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/5] fs/fat: fix handling of full disk
@ 2022-07-31 11:58 Heinrich Schuchardt
  2022-07-31 11:58 ` [PATCH v2 1/5] fs: fat: finding an empty FAT cluster Heinrich Schuchardt
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Heinrich Schuchardt @ 2022-07-31 11:58 UTC (permalink / raw)
  To: Tom Rini; +Cc: AKASHI Takahiro, u-boot, Heinrich Schuchardt

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.

Carve out a function for creating directory entries to avoid code
duplication.

Provide a unit test checking that a full FAT16 root directory is
recognized. For other file systems testing is too time consuming.
FAT32 allows 65536 entries per directory.

v2:
	Handle errors returned by fat_create_dir_entry()
	Add unit test

Heinrich Schuchardt (5):
  fs: fat: finding an empty FAT cluster
  fs: fat: determine_fatent() error handling
  fs: fat: carve out fat_create_dir_entry()
  test: let fs_obj_mkdir() provide full file system type
  test: add test for full FAT16 directory

 fs/fat/fat_write.c                  | 161 ++++++++++++++--------------
 test/py/tests/test_fs/conftest.py   |   6 +-
 test/py/tests/test_fs/test_mkdir.py |  72 ++++++++-----
 3 files changed, 131 insertions(+), 108 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-08-02  0:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-31 11:58 [PATCH v2 0/5] fs/fat: fix handling of full disk Heinrich Schuchardt
2022-07-31 11:58 ` [PATCH v2 1/5] fs: fat: finding an empty FAT cluster Heinrich Schuchardt
2022-08-01  1:02   ` AKASHI Takahiro
2022-08-01  8:21     ` Heinrich Schuchardt
2022-08-02  0:02       ` AKASHI Takahiro
2022-07-31 11:58 ` [PATCH v2 2/5] fs: fat: determine_fatent() error handling Heinrich Schuchardt
2022-07-31 11:58 ` [PATCH v2 3/5] fs: fat: carve out fat_create_dir_entry() Heinrich Schuchardt
2022-07-31 11:58 ` [PATCH v2 4/5] test: let fs_obj_mkdir() provide full file system type Heinrich Schuchardt
2022-07-31 11:58 ` [PATCH v2 5/5] test: add test for full FAT16 directory Heinrich Schuchardt
2022-08-01  1:50   ` AKASHI Takahiro
2022-08-01  6:14     ` Heinrich Schuchardt
2022-08-02  0:19       ` AKASHI Takahiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox