Files
u-boot-tk1-som/include
Łukasz Majewski 8b454eeeea fs:ext4:write:fix: Reinitialize global variables after updating a file
This bug shows up when file stored on the ext4 file system is updated.

The ext4fs_delete_file() is responsible for deleting file's (e.g. uImage)
data.
However some global data (especially ext4fs_indir2_block), which is used
during file deletion are left unchanged.

The ext4fs_indir2_block pointer stores reference to old ext4 double
indirect allocated blocks. When it is unchanged, after file deletion,
ext4fs_write_file() uses the same pointer (since it is already initialized
- i.e. not NULL) to return number of blocks to write. This trunks larger
file when previous one was smaller.

Lets consider following scenario:

1. Flash target with ext4 formatted boot.img (which has uImage [*] on itself)
2. Developer wants to upload their custom uImage [**]
	- When new uImage [**] is smaller than the [*] - everything works
	correctly - we are able to store the whole smaller file with corrupted
	ext4fs_indir2_block pointer
	- When new uImage [**] is larger than the [*] - theCRC is corrupted,
	since truncation on data stored at eMMC was done.
3. When uImage CRC error appears, then reboot and LTHOR/DFU reflashing causes
	proper setting of ext4fs_indir2_block() and after that uImage[**]
	is successfully stored (correct uImage [*] metadata is stored at an
	eMMC on the first flashing).

Due to above the bug was very difficult to reproduce.
This patch sets default values for all ext4fs_indir* pointers/variables.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-05-12 16:31:50 -04:00
..
2013-04-01 16:33:52 -04:00
2014-03-04 12:15:29 -05:00
2013-04-01 16:33:52 -04:00
2014-04-17 14:38:30 -04:00
2014-02-04 16:32:20 +01:00
2014-02-21 08:42:47 -05:00
2014-03-17 20:05:48 -06:00
2014-03-04 12:15:29 -05:00
2014-02-19 09:47:34 -05:00
2014-05-09 11:50:14 +02:00
2014-03-21 16:39:36 -04:00
2014-02-20 06:48:23 +01:00
2013-09-24 09:10:33 -04:00
2014-05-09 11:50:14 +02:00
2014-03-17 20:05:49 -06:00
2013-04-01 16:33:52 -04:00
2013-09-20 10:30:54 -04:00
2014-05-05 08:00:28 +02:00
2013-11-09 17:21:01 +01:00
2014-04-20 13:16:43 +02:00
2014-03-17 20:05:49 -06:00
2014-05-05 08:00:28 +02:00
2013-11-09 17:21:01 +01:00
2014-03-05 12:23:48 +01:00
2014-03-21 16:39:35 -04:00
2014-02-19 10:47:43 -05:00
2013-12-04 08:11:28 -05:00
2013-08-28 11:44:59 -04:00