u-boot/fs
Stefan Brüns de9e831675 ext4: Correct block number handling, empty block vs. error code
read_allocated block may return block number 0, which is just an indicator
a chunk of the file is not backed by a block, i.e. it is sparse.

During file deletions, just continue with the next logical block, for other
operations treat blocknumber <= 0 as an error.

For writes, blocknumber 0 should never happen, as U-Boot always allocates
blocks for the whole file.  Reading already handles this correctly, i.e. the
read buffer is 0-fillled.

Not treating block 0 as sparse block leads to FS corruption, e.g.
	./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
		ext4write host 0 0 /2.5GB.file 1 '
The 2.5GB.file from the fs test is actually a sparse file.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2016-09-23 09:02:44 -04:00
..
cbfs cbfs: Fix incorrect CBFS file header size being used 2016-08-16 11:44:09 +08:00
cramfs kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
ext4 ext4: Correct block number handling, empty block vs. error code 2016-09-23 09:02:44 -04:00
fat fs/fat: Correct description of determine_fatent function 2016-09-23 08:55:57 -04:00
jffs2 nand: Embed mtd_info in struct nand_chip 2016-06-03 20:27:48 -05:00
reiserfs dm: Drop the block_dev_desc_t typedef 2016-03-14 15:34:50 -06:00
sandbox dm: Drop the block_dev_desc_t typedef 2016-03-14 15:34:50 -06:00
ubifs ubifs: fix memory corruption in super.c 2016-04-22 11:48:17 +02:00
yaffs2 mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data 2016-06-03 20:27:48 -05:00
zfs dm: Drop the block_dev_desc_t typedef 2016-03-14 15:34:50 -06:00
fs.c dm: blk: Rename get_device_and_partition() 2016-03-14 15:34:50 -06:00
Kconfig kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
Makefile spl: Add EXT support to SPL 2014-10-27 17:54:03 -04:00