[U-Boot] [PATCH v3 13/13] ext4: initialize full inode for inodes bigger than 128 bytes

Stefan Bruens stefan.bruens at rwth-aachen.de
Tue Sep 6 01:56:34 CEST 2016


On Sonntag, 28. August 2016 22:42:38 CEST you wrote:
> Make sure the the extra_isize field (offset 128) is initialized to 0 to
> mark any extra data as invalid.
> 
> Signed-off-by: Stefan Brüns <stefan.bruens at rwth-aachen.de>
> ---
>  fs/ext4/ext4_write.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> v3: Patch added to series
> 
> diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
> index 81a750b..38fbf68 100644
> --- a/fs/ext4/ext4_write.c
> +++ b/fs/ext4/ext4_write.c
> @@ -454,7 +454,7 @@ static int ext4fs_delete_file(int inodeno)
>  		node_inode->data = ext4fs_root;
>  		node_inode->ino = inodeno;
>  		node_inode->inode_read = 0;
> -		memcpy(&(node_inode->inode), &inode, sizeof(struct ext2_inode));
> +		memcpy(&(node_inode->inode), &inode, fs->inodesz);
This line is actually broken, node_inode->inode is sizeof(struct ext2_inode), 
i.e 128 bytes. It is responsible for the crash Thomas reported.

Kind regards,

Stefan 
-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
work: +49 2405 49936-424


More information about the U-Boot mailing list