u-boot/fs/ext4
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
..
crc16.c ext4fs write support 2012-08-09 23:48:02 +02:00
crc16.h ext4fs write support 2012-08-09 23:48:02 +02:00
dev.c dm: block: Adjust device calls to go through helpers function 2016-03-14 15:34:50 -06:00
ext4_common.c ext4: Correct block number handling, empty block vs. error code 2016-09-23 09:02:44 -04:00
ext4_common.h ext4: propagate error if creation of directory entry fails 2016-09-23 09:02:35 -04:00
ext4_journal.c ext4: fix endianess problems in ext4 write support 2016-09-23 09:02:04 -04:00
ext4_journal.h ext4: fix endianess problems in ext4 write support 2016-09-23 09:02:04 -04:00
ext4_write.c ext4: Correct block number handling, empty block vs. error code 2016-09-23 09:02:44 -04:00
ext4fs.c ext4: use kernel names for byte swaps 2016-09-23 09:02:02 -04:00
Kconfig kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
Makefile fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00