<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/ext4fs.h, branch v2020.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>fs: ext4: Add support for the creation of symbolic links</title>
<updated>2019-04-10T00:03:30+00:00</updated>
<author>
<name>Jean-Jacques Hiblot</name>
<email>jjhiblot@ti.com</email>
</author>
<published>2019-02-13T11:15:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5efc0686eebc0c0daabfbfc2c403f8251b468526'/>
<id>5efc0686eebc0c0daabfbfc2c403f8251b468526</id>
<content type='text'>
Re-use the functions used to write/create a file, to support creation of a
symbolic link.
The difference with a regular file are small:
- The inode mode is flagged with S_IFLNK instead of S_IFREG
- The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG
- Instead of storing the content of a file in allocated blocks, the path
to the target is stored. And if the target's path is short enough, no block
is allocated and the target's path is stored in ext2_inode.b.symlink

As with regulars files, if a file/symlink with the same name exits, it is
unlinked first and then re-created.

Signed-off-by: Jean-Jacques Hiblot &lt;jjhiblot@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
[trini: Fix ext4 env code]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-use the functions used to write/create a file, to support creation of a
symbolic link.
The difference with a regular file are small:
- The inode mode is flagged with S_IFLNK instead of S_IFREG
- The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG
- Instead of storing the content of a file in allocated blocks, the path
to the target is stored. And if the target's path is short enough, no block
is allocated and the target's path is stored in ext2_inode.b.symlink

As with regulars files, if a file/symlink with the same name exits, it is
unlinked first and then re-created.

Signed-off-by: Jean-Jacques Hiblot &lt;jjhiblot@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
[trini: Fix ext4 env code]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: constify the buffer passed to write functions</title>
<updated>2019-04-09T19:34:15+00:00</updated>
<author>
<name>Jean-Jacques Hiblot</name>
<email>jjhiblot@ti.com</email>
</author>
<published>2019-02-13T11:15:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b000180b0f467851525aae3d0dfb8ab3a9dbcf8f'/>
<id>b000180b0f467851525aae3d0dfb8ab3a9dbcf8f</id>
<content type='text'>
There is no need to modify the buffer passed to ext4fs_write_file().
The memset() call is not required here and was likely copied from the
equivalent part of the ext4fs_read_file() function where we do need it.

Signed-off-by: Jean-Jacques Hiblot &lt;jjhiblot@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no need to modify the buffer passed to ext4fs_write_file().
The memset() call is not required here and was likely copied from the
equivalent part of the ext4fs_read_file() function where we do need it.

Signed-off-by: Jean-Jacques Hiblot &lt;jjhiblot@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: cache extent data</title>
<updated>2019-04-09T19:34:15+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2019-01-30T19:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d5aee659f217746395ff58adf3a863627ff02ec1'/>
<id>d5aee659f217746395ff58adf3a863627ff02ec1</id>
<content type='text'>
When a file contains extents, U-Boot currently reads extent-related data
for each block in the file, even if that data is located in the same
block each time. This significantly slows down loading of files that use
extents. Implement a very dumb cache to prevent repeatedly reading the
same block. Files with extents now load as fast as files without.

Note: There are many cases where read_allocated_block() is called. This
patch only addresses one of those places; all others still read redundant
data in any case they did before. This is a minimal patch to fix the
load command; other cases aren't fixed.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a file contains extents, U-Boot currently reads extent-related data
for each block in the file, even if that data is located in the same
block each time. This significantly slows down loading of files that use
extents. Implement a very dumb cache to prevent repeatedly reading the
same block. Files with extents now load as fast as files without.

Note: There are many cases where read_allocated_block() is called. This
patch only addresses one of those places; all others still read redundant
data in any case they did before. This is a minimal patch to fix the
load command; other cases aren't fixed.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: do not write on filesystem with metadata_csum feature</title>
<updated>2019-03-22T16:15:24+00:00</updated>
<author>
<name>Sébastien Szymanski</name>
<email>sebastien.szymanski@armadeus.com</email>
</author>
<published>2019-03-22T08:33:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2e7365518acdb8fb6e9be332c8a6c57b457188d9'/>
<id>2e7365518acdb8fb6e9be332c8a6c57b457188d9</id>
<content type='text'>
U-Boot doesn't support metadata_csum feature. Writing to filesystem with
metadata_csum feature makes the filesystem corrupted and unbootable by
Linux:

[    2.527495] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 0 failed (52188!=0)
[    2.537421] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 1 failed (5262!=0)
...
[    2.653308] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 14 failed (42611!=0)
[    2.662179] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 15 failed (21527!=0)
[    2.687920] JBD2: journal checksum error
[    2.691982] EXT4-fs (mmcblk0p2): error loading journal
[    2.698292] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -74

Don't write to filesystem with meatadata_csum feature to not corrupt the
filesystem.

Signed-off-by: Sébastien Szymanski &lt;sebastien.szymanski@armadeus.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
U-Boot doesn't support metadata_csum feature. Writing to filesystem with
metadata_csum feature makes the filesystem corrupted and unbootable by
Linux:

[    2.527495] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 0 failed (52188!=0)
[    2.537421] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 1 failed (5262!=0)
...
[    2.653308] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 14 failed (42611!=0)
[    2.662179] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 15 failed (21527!=0)
[    2.687920] JBD2: journal checksum error
[    2.691982] EXT4-fs (mmcblk0p2): error loading journal
[    2.698292] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -74

Don't write to filesystem with meatadata_csum feature to not corrupt the
filesystem.

Signed-off-by: Sébastien Szymanski &lt;sebastien.szymanski@armadeus.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Allow reading files with non-zero offset, clamp read len</title>
<updated>2016-11-21T19:07:27+00:00</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-11-06T17:33:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=66a47ff2d8f037e1e9d641623257894a9975c325'/>
<id>66a47ff2d8f037e1e9d641623257894a9975c325</id>
<content type='text'>
Support was already implemented, but not hooked up. This fixes several
fails in the test cases.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Acked-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support was already implemented, but not hooked up. This fixes several
fails in the test cases.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Acked-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Use helper function to access group descriptor and its fields</title>
<updated>2016-09-23T13:20:15+00:00</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-17T00:10:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=688d0e79f657ed0b60e5b721bd00540021e1e518'/>
<id>688d0e79f657ed0b60e5b721bd00540021e1e518</id>
<content type='text'>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: determine group descriptor size for 64bit feature</title>
<updated>2016-09-23T13:18:56+00:00</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-17T00:10:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fc214ef90910159f33fbe92a6cb77839a27fa8a6'/>
<id>fc214ef90910159f33fbe92a6cb77839a27fa8a6</id>
<content type='text'>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Avoid corruption of directories with hash tree indexes</title>
<updated>2016-09-23T13:02:37+00:00</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-06T02:36:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10a7a1b8babbdd5684684da31482eab1931316f0'/>
<id>10a7a1b8babbdd5684684da31482eab1931316f0</id>
<content type='text'>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: fix possible crash on directory traversal, ignore deleted entries</title>
<updated>2016-09-23T13:02:34+00:00</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-06T02:36:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=76a29519ff87dd6a014d841a3a6e501d3b2f5153'/>
<id>76a29519ff87dd6a014d841a3a6e501d3b2f5153</id>
<content type='text'>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Refuse to mount filesystems with 64bit feature set</title>
<updated>2016-08-05T11:27:14+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2016-07-22T21:59:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f94ab6656ceffb3f2a972c8de4c554502b6f2b7'/>
<id>6f94ab6656ceffb3f2a972c8de4c554502b6f2b7</id>
<content type='text'>
With e2fsprogs after 1.43 the 64bit and metadata_csum features are
enabled by default.  The metadata_csum feature changes how
ext4_group_desc-&gt;bg_checksum is calculated, which would break write
support.  The 64bit feature however introduces changes such that it
cannot be read by implementations that do not support it.  Since we do
not support this, we must not mount it.

Cc: Stephen Warren &lt;swarren@nvidia.com&gt;
Cc: Simon Glass &lt;sjg@chromium.org&gt;
Cc: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Cc: Stefan Roese &lt;sr@denx.de&gt;
Reported-by: Andrew Bradford &lt;andrew.bradford@kodakalaris.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With e2fsprogs after 1.43 the 64bit and metadata_csum features are
enabled by default.  The metadata_csum feature changes how
ext4_group_desc-&gt;bg_checksum is calculated, which would break write
support.  The 64bit feature however introduces changes such that it
cannot be read by implementations that do not support it.  Since we do
not support this, we must not mount it.

Cc: Stephen Warren &lt;swarren@nvidia.com&gt;
Cc: Simon Glass &lt;sjg@chromium.org&gt;
Cc: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Cc: Stefan Roese &lt;sr@denx.de&gt;
Reported-by: Andrew Bradford &lt;andrew.bradford@kodakalaris.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
