| #
749e93ee |
| 19-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Respect group descriptor size when adjusting free counts
Also adjust high 16/32 bits when free inode/block counts are modified.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
| #
688d0e79 |
| 17-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Use helper function to access group descriptor and its fields
The descriptor size is variable, thus array indices are not generically applicable. The larger group descriptors also contain e.g.
ext4: Use helper function to access group descriptor and its fields
The descriptor size is variable, thus array indices are not generically applicable. The larger group descriptors also contain e.g. high parts of block numbers, which have to be read and written.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| #
de9e8316 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
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 sp
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>
show more ...
|
| #
b779e029 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: remove duplicated block release code for extents
The data blocks are identical for files using traditional direct/indirect block allocation scheme and extent trees, thus this code part can be
ext4: remove duplicated block release code for extents
The data blocks are identical for files using traditional direct/indirect block allocation scheme and extent trees, thus this code part can be common. Only the code to deallocate the indirect blocks to record the used blocks has to be seperate, respectively the code to release extent tree index blocks.
Actually the code to release the extent tree index blocks is still missing, but at least add a FIXME at the appropriate place.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| #
87f9fdc0 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: initialize full inode for inodes bigger than 128 bytes
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 <st
ext4: initialize full inode for inodes bigger than 128 bytes
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@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
290ce2f9 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Use correct value for inode size even on revision 0 filesystems
fs->inodesz is already correctly (i.e. dependent on fs revision) initialized in ext4fs_mount.
Signed-off-by: Stefan Brüns <stef
ext4: Use correct value for inode size even on revision 0 filesystems
fs->inodesz is already correctly (i.e. dependent on fs revision) initialized in ext4fs_mount.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
87a40b6e |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Fix memory leak in case of failure
temp_ptr should always be freed, even if the function is left via goto fail.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz
ext4: Fix memory leak in case of failure
temp_ptr should always be freed, even if the function is left via goto fail.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
10a7a1b8 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Avoid corruption of directories with hash tree indexes
While directories can be read using the old linear scan method, adding a new file would require updating the index tree (alternatively, t
ext4: Avoid corruption of directories with hash tree indexes
While directories can be read using the old linear scan method, adding a new file would require updating the index tree (alternatively, the whole tree could be removed).
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
a0d767e2 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: propagate error if creation of directory entry fails
In case the dir entry creation failed, ext4fs_write would later overwrite a random inode, as inodeno was never initialized.
Signed-off-by:
ext4: propagate error if creation of directory entry fails
In case the dir entry creation failed, ext4fs_write would later overwrite a random inode, as inodeno was never initialized.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
76a29519 |
| 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: fix possible crash on directory traversal, ignore deleted entries
The following command triggers a segfault in search_dir: ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
ext4: fix possible crash on directory traversal, ignore deleted entries
The following command triggers a segfault in search_dir: ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ; ext4write host 0 0 /./foo 0x10'
The following command triggers a segfault in check_filename: ./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ; ext4write host 0 0 /. 0x10'
"." is the first entry in the directory, thus previous_dir is NULL. The whole previous_dir block in search_dir seems to be a bad copy from check_filename(...). As the changed data is not written to disk, the statement is mostly harmless, save the possible NULL-ptr reference.
Typically a file is unlinked by extending the direntlen of the previous entry. If the entry is the first entry in the directory block, it is invalidated by setting inode=0.
The inode==0 case is hard to trigger without crafted filesystems. It only hits if the first entry in a directory block is deleted and later a lookup for the entry (by name) is done.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
58a9ecba |
| 01-Sep-2016 |
Michael Walle <michael@walle.cc> |
ext4: fix endianess problems in ext4 write support
All fields were accessed directly instead of using the proper byte swap functions. Thus, ext4 write support was only usable on little-endian archit
ext4: fix endianess problems in ext4 write support
All fields were accessed directly instead of using the proper byte swap functions. Thus, ext4 write support was only usable on little-endian architectures. Fix this.
Signed-off-by: Michael Walle <michael@walle.cc>
show more ...
|
| #
7f101be3 |
| 29-Aug-2016 |
Michael Walle <michael@walle.cc> |
ext4: use kernel names for byte swaps
Instead of __{be,le}{16,32}_to_cpu use {be,le}{16,32}_to_cpu.
Signed-off-by: Michael Walle <michael@walle.cc>
|
| #
13a39725 |
| 14-Oct-2015 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge remote-tracking branch 'u-boot/master'
|
| #
676505f5 |
| 05-Sep-2015 |
Stephen Warren <swarren@nvidia.com> |
ext4: avoid calling ext4fs_mount() twice, which leaks
ext4_write_file() is only called from the "fs" layer, which calls both ext4fs_mount() and ext4fs_close() before/after calling ext4_write_file().
ext4: avoid calling ext4fs_mount() twice, which leaks
ext4_write_file() is only called from the "fs" layer, which calls both ext4fs_mount() and ext4fs_close() before/after calling ext4_write_file(). Fix ext4_write_file() not to call ext4fs_mount() again, since the mount operation malloc()s some RAM which is leaked when a second mount call over-writes the pointer to that data, if no intervening close call is made.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
cf92e05c |
| 02-Sep-2015 |
Simon Glass <sjg@chromium.org> |
Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header
Now that we have a new header file for cache-aligned allocation, we should move the stack-based allocation macro there also.
Signed-off-
Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header
Now that we have a new header file for cache-aligned allocation, we should move the stack-based allocation macro there also.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
22b7509e |
| 17-Feb-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
fs: ext4 write: return file len on success
After rework of the file system API, the size of ext4 write was missed. This causes printing unreliable write size at the end of the file system write oper
fs: ext4 write: return file len on success
After rework of the file system API, the size of ext4 write was missed. This causes printing unreliable write size at the end of the file system write operation.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| #
9f12cd0e |
| 17-Nov-2014 |
Suriyan Ramasami <suriyan.r@gmail.com> |
ext4: Prepare API change for files greater than 2GB
Change the internal EXT4 functions to use loff_t for offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@ch
ext4: Prepare API change for files greater than 2GB
Change the internal EXT4 functions to use loff_t for offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> [trini: Update common/spl/spl_ext.c] Signed-off-by: Tom Rini <trini@ti.com>
show more ...
|
| #
dab5e346 |
| 16-Jul-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Conflicts: boards.cfg
|
| #
ed1d98d8 |
| 25-Jun-2014 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
46a5707d |
| 09-Jun-2014 |
Jeroen Hofstee <jeroen@myspectrum.nl> |
ext4: correctly zero filename
Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename sizeof(filename) is not the size of the buffer. Use the already known length instead.
cc: Uma Shankar <uma
ext4: correctly zero filename
Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename sizeof(filename) is not the size of the buffer. Use the already known length instead.
cc: Uma Shankar <uma.shankar@samsung.com> cc: Manjunatha C Achar <a.manjunatha@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
05d134b0 |
| 20-May-2014 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge remote-tracking branch 'u-boot/master'
Conflicts: boards.cfg
Conflicts were trivial once u-boot-arm/master boards.cfg was reformatted (commit 6130c146) to match u-boot/master's own reformatt
Merge remote-tracking branch 'u-boot/master'
Conflicts: boards.cfg
Conflicts were trivial once u-boot-arm/master boards.cfg was reformatted (commit 6130c146) to match u-boot/master's own reformatting (commit 1b37fa83).
show more ...
|
| #
4180b3db |
| 14-May-2014 |
Marek Vasut <marex@denx.de> |
Merge remote-tracking branch 'u-boot/master' into test
|
| #
8b454eee |
| 06-May-2014 |
Łukasz Majewski <l.majewski@samsung.com> |
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 fi
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>
show more ...
|
| #
35dd055b |
| 06-May-2014 |
Łukasz Majewski <l.majewski@samsung.com> |
fs:ext4:cleanup: Remove superfluous code
Code responsible for handling situation when ext4 has block size of 1024B can be ordered to take less space.
This patch does that for ext4 common and write
fs:ext4:cleanup: Remove superfluous code
Code responsible for handling situation when ext4 has block size of 1024B can be ordered to take less space.
This patch does that for ext4 common and write files.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| #
17998eff |
| 11-Feb-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm
|