u-boot/fs/ext4
Gero Schumacher 1c48fda3e5 fs: ext4: Problem with ext4load and sparse files
Hi,

when I try to load a sparse file via ext4load, I am getting the error message
'invalid extent'

After a deeper look in the code, it seems to be an issue in the function ext4fs_get_extent_block in fs/ext4/ext4_common.c:

The file starts with 1k of zeros. The blocksize is 1024. So the first extend block contains the following information:

eh_entries: 1
eh_depth: 1
ei_block 1

When the upper layer (ext4fs_read_file) asks for fileblock 0, we are running in the 'invalid extent' error message.
For me it seems, that the code is not prepared for handling a sparse block at the beginning of the file. The following change, solved my problem:

I am really not an expert in ext4 filesystems. Can somebody please have a look at this issue and give me a feedback, if I am totally wrong or not?
2019-04-09 20:04:03 -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 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ext4_common.c fs: ext4: Problem with ext4load and sparse files 2019-04-09 20:04:03 -04:00
ext4_common.h fs: ext4: constify the buffer passed to write functions 2019-04-09 15:34:15 -04:00
ext4_journal.c fs: ext4: cache extent data 2019-04-09 15:34:15 -04:00
ext4_journal.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ext4_write.c fs: ext4: Add support for the creation of symbolic links 2019-04-09 20:03:30 -04:00
ext4fs.c fs: ext4: cache extent data 2019-04-09 15:34:15 -04:00
Kconfig fs: Migrate ext4 to Kconfig 2018-01-22 16:43:30 -05:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00