<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/ext4, branch v2014.07</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: fix writing zero-length files</title>
<updated>2014-06-19T15:18:53+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-06-11T18:46:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d018028055a21a28adef16b7f95422c426b46d60'/>
<id>d018028055a21a28adef16b7f95422c426b46d60</id>
<content type='text'>
ext4fs_allocate_blocks() always allocates at least one block for a file.
If the file size is zero, this causes total_remaining_blocks to
underflow, which then causes an apparent hang while 2^32 blocks are
allocated.

To solve this, check that total_remaining_blocks is non-zero as part of
the loop condition (i.e. before each loop) rather than at the end of
the loop.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ext4fs_allocate_blocks() always allocates at least one block for a file.
If the file size is zero, this causes total_remaining_blocks to
underflow, which then causes an apparent hang while 2^32 blocks are
allocated.

To solve this, check that total_remaining_blocks is non-zero as part of
the loop condition (i.e. before each loop) rather than at the end of
the loop.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: correctly zero filename</title>
<updated>2014-06-11T20:27:05+00:00</updated>
<author>
<name>Jeroen Hofstee</name>
<email>jeroen@myspectrum.nl</email>
</author>
<published>2014-06-09T13:29:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=46a5707d9c2eefa23e88f7c63999adb9190c5b46'/>
<id>46a5707d9c2eefa23e88f7c63999adb9190c5b46</id>
<content type='text'>
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 &lt;uma.shankar@samsung.com&gt;
cc: Manjunatha C Achar &lt;a.manjunatha@samsung.com&gt;
cc: Marek Vasut &lt;marek.vasut@gmail.com&gt;
Signed-off-by: Jeroen Hofstee &lt;jeroen@myspectrum.nl&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;uma.shankar@samsung.com&gt;
cc: Manjunatha C Achar &lt;a.manjunatha@samsung.com&gt;
cc: Marek Vasut &lt;marek.vasut@gmail.com&gt;
Signed-off-by: Jeroen Hofstee &lt;jeroen@myspectrum.nl&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs:ext4:write:fix: Reinitialize global variables after updating a file</title>
<updated>2014-05-12T20:31:50+00:00</updated>
<author>
<name>Łukasz Majewski</name>
<email>l.majewski@samsung.com</email>
</author>
<published>2014-05-06T07:36:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8b454eeeea0ba021ee27f3e103daf1f8fa87bd16'/>
<id>8b454eeeea0ba021ee27f3e103daf1f8fa87bd16</id>
<content type='text'>
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 &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs:ext4:cleanup: Remove superfluous code</title>
<updated>2014-05-12T20:31:50+00:00</updated>
<author>
<name>Łukasz Majewski</name>
<email>l.majewski@samsung.com</email>
</author>
<published>2014-05-06T07:36:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=35dd055b94eb3ed8c21595eedd740431866b2f26'/>
<id>35dd055b94eb3ed8c21595eedd740431866b2f26</id>
<content type='text'>
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 &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ext4fs: Add ext4 extent cache for read operations"</title>
<updated>2014-02-26T13:18:58+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@ti.com</email>
</author>
<published>2014-02-26T13:18:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=715b56fe2b47e073e6f2425e0cedba0e92a4014d'/>
<id>715b56fe2b47e073e6f2425e0cedba0e92a4014d</id>
<content type='text'>
This reverts commit fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5.

The author has asked on the mailing list that we revert this for now as
it breaks write support.

Reported-by: Łukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5.

The author has asked on the mailing list that we revert this for now as
it breaks write support.

Reported-by: Łukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs: Add ext4 extent cache for read operations</title>
<updated>2014-02-21T16:33:18+00:00</updated>
<author>
<name>Ionut Nicu</name>
<email>ioan.nicu.ext@nsn.com</email>
</author>
<published>2014-02-04T14:48:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5'/>
<id>fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5</id>
<content type='text'>
In an ext4 filesystem, the inode corresponding to a file has a 60-byte
area which contains an extent header structure and up to 4 extent
structures (5 x 12 bytes).

For files that need more than 4 extents to be represented (either files
larger than 4 x 128MB = 512MB or smaller files but very fragmented),
ext4 creates extent index structures. Each extent index points to a 4KB
physical block where one extent header and additional 340 extents could
be stored.

The current u-boot ext4 code is very inefficient when it tries to load a
file which has extent indexes. For each logical file block the code will
read over and over again the same blocks of 4096 bytes from the disk.

Since the extent tree in a file is always the same, we can cache the
extent structures in memory before actually starting to read the file.

This patch creates a simple linked list of structures holding information
about all the extents used to represent a file. The list is sorted by
the logical block number (ee_block) so that we can easily find the
proper extent information for any file block.

Without this patch, a 69MB file which had just one extent index pointing
to a block with another 6 extents was read in approximately 3 minutes.
With this patch applied the same file can be read in almost 20 seconds.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In an ext4 filesystem, the inode corresponding to a file has a 60-byte
area which contains an extent header structure and up to 4 extent
structures (5 x 12 bytes).

For files that need more than 4 extents to be represented (either files
larger than 4 x 128MB = 512MB or smaller files but very fragmented),
ext4 creates extent index structures. Each extent index points to a 4KB
physical block where one extent header and additional 340 extents could
be stored.

The current u-boot ext4 code is very inefficient when it tries to load a
file which has extent indexes. For each logical file block the code will
read over and over again the same blocks of 4096 bytes from the disk.

Since the extent tree in a file is always the same, we can cache the
extent structures in memory before actually starting to read the file.

This patch creates a simple linked list of structures holding information
about all the extents used to represent a file. The list is sorted by
the logical block number (ee_block) so that we can easily find the
proper extent information for any file block.

Without this patch, a 69MB file which had just one extent index pointing
to a block with another 6 extents was read in approximately 3 minutes.
With this patch applied the same file can be read in almost 20 seconds.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: implement exists() for ext4fs</title>
<updated>2014-02-19T14:47:34+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-02-03T20:21:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=55af5c9313607f3b6acba2fd915b263ef6a61dd4'/>
<id>55af5c9313607f3b6acba2fd915b263ef6a61dd4</id>
<content type='text'>
This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the ext4 filesystem.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the ext4 filesystem.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs: fix "invalid extent block" error</title>
<updated>2014-01-20T15:09:40+00:00</updated>
<author>
<name>Ionut Nicu</name>
<email>ioan.nicu.ext@nsn.com</email>
</author>
<published>2014-01-13T11:00:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b5bbac1a9b07016602559ff483df265fef6c1f83'/>
<id>b5bbac1a9b07016602559ff483df265fef6c1f83</id>
<content type='text'>
For files where we actually have extent indexes following
an extent header (ext_block-&gt;eh_depth != 0), the do/while
loop from ext4fs_get_extent_block() does not select the
proper extent index structure.

For example, if we have:

ext_block-&gt;eh_depth = 1
ext_block-&gt;eh_entries = 1
fileblock = 0
index[0].ei_block = 0

the do/while loop will exit with i set to 0 and the
ext4fs_get_extent_block() function will return 0, even if
there was a valid extent index structure following the
header.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Signed-off-by: Mathias Rulf &lt;mathias.rulf@nsn.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For files where we actually have extent indexes following
an extent header (ext_block-&gt;eh_depth != 0), the do/while
loop from ext4fs_get_extent_block() does not select the
proper extent index structure.

For example, if we have:

ext_block-&gt;eh_depth = 1
ext_block-&gt;eh_entries = 1
fileblock = 0
index[0].ei_block = 0

the do/while loop will exit with i set to 0 and the
ext4fs_get_extent_block() function will return 0, even if
there was a valid extent index structure following the
header.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Signed-off-by: Mathias Rulf &lt;mathias.rulf@nsn.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs: use EXT2_BLOCK_SIZE instead of fs-&gt;blksz</title>
<updated>2014-01-20T15:09:40+00:00</updated>
<author>
<name>Ionut Nicu</name>
<email>ioan.nicu.ext@nsn.com</email>
</author>
<published>2014-01-13T10:59:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=470173274d9ceb18a7140ef93e20be6c2236e7d9'/>
<id>470173274d9ceb18a7140ef93e20be6c2236e7d9</id>
<content type='text'>
Using fs-&gt;blksz in ext4fs_get_extent_block() is not
correct since fs-&gt;blksz is not initialized on the
read path. Use EXT2_BLOCK_SIZE() instead which will
produce the desired output.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Signed-off-by: Mathias Rulf &lt;mathias.rulf@nsn.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using fs-&gt;blksz in ext4fs_get_extent_block() is not
correct since fs-&gt;blksz is not initialized on the
read path. Use EXT2_BLOCK_SIZE() instead which will
produce the desired output.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Signed-off-by: Mathias Rulf &lt;mathias.rulf@nsn.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ext4: fix calling put_ext4 with truncated offset</title>
<updated>2014-01-20T15:09:38+00:00</updated>
<author>
<name>Ma Haijun</name>
<email>mahaijuns@gmail.com</email>
</author>
<published>2014-01-08T00:15:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0550870b1c590be6beb09b57762ec43b5516f7d1'/>
<id>0550870b1c590be6beb09b57762ec43b5516f7d1</id>
<content type='text'>
Curently, we are using 32 bit multiplication to calculate the offset,
so the result will always be 32 bit.
This can silently cause file system corruption when performing a write
operation on partition larger than 4 GiB.

This patch address the issue by simply promoting the terms to 64 bit,
and let compilers decide how to do the multiplication efficiently.

Signed-off-by: Ma Haijun &lt;mahaijuns@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Curently, we are using 32 bit multiplication to calculate the offset,
so the result will always be 32 bit.
This can silently cause file system corruption when performing a write
operation on partition larger than 4 GiB.

This patch address the issue by simply promoting the terms to 64 bit,
and let compilers decide how to do the multiplication efficiently.

Signed-off-by: Ma Haijun &lt;mahaijuns@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
