u-boot/fs
Reno Farnesi 76216211f8 fs: fat: fix fatwrite overflow calculation
The overflow calculation was incorrect. Adding the start block of the
partition is not needed because the sectors are already relative to the
beginning of the partition. If you attempted to write a file smaller
than cur_part_info.start blocks on a full partition the old calculation
fails to catch the overflow. This would cause an infinite loop in the
determine_fatent function.

Old, incorrect calculation:

ending sector of new file = start sector + file size (in sectors)
last sector = partition start + total sectors on the partition

Adding the partition start block number is not needed because sectors
are already relative to the start of the partition.

New calculation:

ending sector of new file = start sector + file size (in sectors)
last sector = total sectors on the partition

Signed-off-by: Reno Farnesi <nfarnesi4@gmail.com>
2017-08-26 14:56:07 -04:00
..
cbfs fs: Kconfig: Add a separate config for FS_CBFS 2017-04-30 13:40:57 -04:00
cramfs fs: Kconfig: Add a separate option for FS_CRAMFS 2017-04-30 13:40:59 -04:00
ext4 ext4: Fix comparision of unsigned expression with < 0 2017-04-27 16:49:09 -04:00
fat fs: fat: fix fatwrite overflow calculation 2017-08-26 14:56:07 -04:00
jffs2 fs: use get_nand_dev_by_index() 2017-07-11 22:41:47 -04:00
reiserfs dm: Drop the block_dev_desc_t typedef 2016-03-14 15:34:50 -06:00
sandbox sandboxfs: Fix resource leak 2016-12-02 10:37:47 -07:00
ubifs env: Rename common functions related to setenv() 2017-08-16 08:23:32 -04:00
yaffs2 Convert CONFIG_CMD_YAFFS2 to Kconfig 2017-08-11 17:44:50 -04:00
zfs dm: Drop the block_dev_desc_t typedef 2016-03-14 15:34:50 -06:00
fs.c env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
Kconfig Convert CONFIG_CMD_YAFFS2 to Kconfig 2017-08-11 17:44:50 -04:00
Makefile fs: Kconfig: Add a separate option for FS_JFFS2 2017-05-22 12:45:31 -04:00