| b3e1edf2 | 27-Sep-2017 |
Tom Rini <trini@konsulko.com> |
UPSTREAM: fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls
As reported by Coverity, we did not free dirnode in the case of failure. Do so now.
Change-Id: I6af93d24c33302d8911ff0021d1c1b067
UPSTREAM: fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls
As reported by Coverity, we did not free dirnode in the case of failure. Do so now.
Change-Id: I6af93d24c33302d8911ff0021d1c1b067d2a2715 Reported-by: Coverity (CID: 131221) Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit fa9ca8a5d271e0533f61222df2bd6fd512687dbd)
show more ...
|
| 66a47ff2 | 06-Nov-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Allow reading files with non-zero offset, clamp read len
Support was already implemented, but not hooked up. This fixes several fails in the test cases.
Signed-off-by: Stefan Brüns <stefan.br
ext4: Allow reading files with non-zero offset, clamp read len
Support was already implemented, but not hooked up. This fixes several fails in the test cases.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
show more ...
|
| 805e3e00 | 09-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Only write journal entries for modified blocks in unlink_filename
Instead of creating a journal entry for each directory block, even if the block is unmodified, only log the modified block.
S
ext4: Only write journal entries for modified blocks in unlink_filename
Instead of creating a journal entry for each directory block, even if the block is unmodified, only log the modified block.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| d1bdf224 | 09-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Fix handling of direntlen in unlink_filename
The direntlen checks were quite bogus, i.e. the loop termination used "len + offset == blocksize" (exact match only), and checked for a direntlen l
ext4: Fix handling of direntlen in unlink_filename
The direntlen checks were quite bogus, i.e. the loop termination used "len + offset == blocksize" (exact match only), and checked for a direntlen less than 0. The latter can never happen as the len is unsigned, this has been reported by Coverity, CID 153384.
Use the same code as in search_dir for directory traversal. This code has the correct checks for direntlen >= sizeof(struct dirent), and offset < blocksize.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reported-by: Coverity (CID: 153383, 153384) Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| b4976b49 | 17-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Revert rejection of 64bit enabled ext4 fs
Enable mounting of ext4 fs with 64bit feature, as it is supported now. These had been disabled in 6f94ab6656ceffb3f2a972c8de4c554502b6f2b7.
Signed-of
ext4: Revert rejection of 64bit enabled ext4 fs
Enable mounting of ext4 fs with 64bit feature, as it is supported now. These had been disabled in 6f94ab6656ceffb3f2a972c8de4c554502b6f2b7.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| 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 ...
|
| f798b1dd | 17-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Use correct descriptor size when reading the block group descriptor
The correct descriptor size must be used when calculating offsets, and also to read the correct amount of data.
Signed-off-
ext4: Use correct descriptor size when reading the block group descriptor
The correct descriptor size must be used when calculating offsets, and also to read the correct amount of data.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| 9f5dd8b6 | 19-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Add helper functions for block group descriptor field access
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal
ext4: Add helper functions for block group descriptor field access
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal with the endianess of the fields, and with split fields like free_blocks/ free_blocks_high.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| fc214ef9 | 17-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: determine group descriptor size for 64bit feature
If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from the superblocks, otherwise it defaults to 32.
Signed-off-by: Stefan Br
ext4: determine group descriptor size for 64bit feature
If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from the superblocks, otherwise it defaults to 32.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
show more ...
|
| b1edcf0d | 06-Sep-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
ext4: Fix memory leak of journal buffer if block is updated multiple times
If the same block is updated multiple times in a row during a single file system operation, gd_index is decremented to use
ext4: Fix memory leak of journal buffer if block is updated multiple times
If the same block is updated multiple times in a row during a single file system operation, gd_index is decremented to use the same journal entry again. Avoid loosing the already allocated buffer.
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 ...
|