<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs, branch v2015.10</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/fat/fat_write: Fix management of empty files</title>
<updated>2015-10-11T21:12:08+00:00</updated>
<author>
<name>Benoît Thébaudeau</name>
<email>benoit@wsystem.com</email>
</author>
<published>2015-09-28T13:45:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1254b44a9f31c78ce7325eb392eaa949a2c7fc9a'/>
<id>1254b44a9f31c78ce7325eb392eaa949a2c7fc9a</id>
<content type='text'>
Overwriting an empty file not created by U-Boot did not work, and it
could even corrupt the FAT. Moreover, creating empty files or emptying
existing files allocated a cluster, which is not standard.

Fix this by always keeping empty files clusterless as specified by
Microsoft (the start cluster must be set to 0 in the directory entry in
that case), and by supporting overwriting such files.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Overwriting an empty file not created by U-Boot did not work, and it
could even corrupt the FAT. Moreover, creating empty files or emptying
existing files allocated a cluster, which is not standard.

Fix this by always keeping empty files clusterless as specified by
Microsoft (the start cluster must be set to 0 in the directory entry in
that case), and by supporting overwriting such files.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat_write: Factor out duplicate code</title>
<updated>2015-10-11T21:12:08+00:00</updated>
<author>
<name>Benoît Thébaudeau</name>
<email>benoit@wsystem.com</email>
</author>
<published>2015-09-28T13:45:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e876be4b5ccb661d68b5b83330e134ace339316c'/>
<id>e876be4b5ccb661d68b5b83330e134ace339316c</id>
<content type='text'>
Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat_write: Fix curclust/newclust mix-up</title>
<updated>2015-10-11T21:12:07+00:00</updated>
<author>
<name>Benoît Thébaudeau</name>
<email>benoit@wsystem.com</email>
</author>
<published>2015-09-28T13:45:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5e1a860e6cd6d42d9ae16c9d9abbde46514da46d'/>
<id>5e1a860e6cd6d42d9ae16c9d9abbde46514da46d</id>
<content type='text'>
curclust was used instead of newclust in the debug() calls and in one
CHECK_CLUST() call, which could skip a failure case.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
curclust was used instead of newclust in the debug() calls and in one
CHECK_CLUST() call, which could skip a failure case.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat_write: Merge calls to set_cluster()</title>
<updated>2015-10-11T21:12:07+00:00</updated>
<author>
<name>Benoît Thébaudeau</name>
<email>benoit@wsystem.com</email>
</author>
<published>2015-09-28T13:45:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1d7f2ece69c9d80264321bc4ee07f57eec392538'/>
<id>1d7f2ece69c9d80264321bc4ee07f57eec392538</id>
<content type='text'>
set_contents() had uselessly split calls to set_cluster(). Merge these
calls, which removes some cases of set_cluster() being called with a
size of zero.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
set_contents() had uselessly split calls to set_cluster(). Merge these
calls, which removes some cases of set_cluster() being called with a
size of zero.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat_write: Fix buffer alignments</title>
<updated>2015-10-11T21:12:07+00:00</updated>
<author>
<name>Benoît Thébaudeau</name>
<email>benoit@wsystem.com</email>
</author>
<published>2015-09-28T13:45:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8133f43d1cd4f0df0a6b4c2aa99a47753fda20d6'/>
<id>8133f43d1cd4f0df0a6b4c2aa99a47753fda20d6</id>
<content type='text'>
set_cluster() was using a temporary buffer without enforcing its
alignment for DMA and cache. Moreover, it did not check the alignment of
the passed buffer, which can come directly from applicative code or from
the user.

This could cause random data corruption, which has been observed on
i.MX25 writing to an SD card.

Fix this by only passing ARCH_DMA_MINALIGN-aligned buffers to
disk_write(), which requires the introduction of a buffer bouncing
mechanism for the misaligned buffers passed to set_cluster().

By the way, improve the handling of the corresponding return values from
disk_write():
 - print them with debug() in case of error,
 - consider that there is an error is disk_write() returns a smaller
   block count than the requested one, not only if its return value is
   negative.

After this change, set_cluster() and get_cluster() are almost
symmetrical.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
set_cluster() was using a temporary buffer without enforcing its
alignment for DMA and cache. Moreover, it did not check the alignment of
the passed buffer, which can come directly from applicative code or from
the user.

This could cause random data corruption, which has been observed on
i.MX25 writing to an SD card.

Fix this by only passing ARCH_DMA_MINALIGN-aligned buffers to
disk_write(), which requires the introduction of a buffer bouncing
mechanism for the misaligned buffers passed to set_cluster().

By the way, improve the handling of the corresponding return values from
disk_write():
 - print them with debug() in case of error,
 - consider that there is an error is disk_write() returns a smaller
   block count than the requested one, not only if its return value is
   negative.

After this change, set_cluster() and get_cluster() are almost
symmetrical.

Signed-off-by: Benoît Thébaudeau &lt;benoit@wsystem.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: fix symlink read function</title>
<updated>2015-09-11T21:15:29+00:00</updated>
<author>
<name>Gary Bisson</name>
<email>gary.bisson@boundarydevices.com</email>
</author>
<published>2015-09-07T09:20:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9d2f6a9ae70d06e4cead539e57f264c980643f53'/>
<id>9d2f6a9ae70d06e4cead539e57f264c980643f53</id>
<content type='text'>
Since last API changes for files &gt;2GB, the read of symlink is broken as
ext4fs_read_file now returns 0 instead of the length of the actual read.

Signed-off-by: Gary Bisson &lt;gary.bisson@boundarydevices.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since last API changes for files &gt;2GB, the read of symlink is broken as
ext4fs_read_file now returns 0 instead of the length of the actual read.

Signed-off-by: Gary Bisson &lt;gary.bisson@boundarydevices.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: fix leak in check_filename()</title>
<updated>2015-09-11T21:15:23+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2015-09-05T04:03:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d56b2015e6d5695d009d8e5e3930cbf34c3b5da0'/>
<id>d56b2015e6d5695d009d8e5e3930cbf34c3b5da0</id>
<content type='text'>
root_first_block_buffer should be free()d in all cases, not just when an
error occurs. Fix the success exit path of the function to do this.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
root_first_block_buffer should be free()d in all cases, not just when an
error occurs. Fix the success exit path of the function to do this.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: free allocations by parse_path()</title>
<updated>2015-09-11T21:15:22+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2015-09-05T04:03:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=934b14f2bb306dfa1947d30f4df90cdc8b710332'/>
<id>934b14f2bb306dfa1947d30f4df90cdc8b710332</id>
<content type='text'>
parse_path() malloc()s the entries in the array it's passed. Those
allocations must be free()d by the caller, ext4fs_get_parent_inode_num().
Add code to do this.

For this to work, all the array entries must be dynamically allocated,
rather than a mix of dynamic and static allocations. Fix parse_path() not
to over-write arr[0] with a pointer to statically allocated data.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
parse_path() malloc()s the entries in the array it's passed. Those
allocations must be free()d by the caller, ext4fs_get_parent_inode_num().
Add code to do this.

For this to work, all the array entries must be dynamically allocated,
rather than a mix of dynamic and static allocations. Fix parse_path() not
to over-write arr[0] with a pointer to statically allocated data.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: avoid calling ext4fs_mount() twice, which leaks</title>
<updated>2015-09-11T21:15:22+00:00</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2015-09-05T04:03:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=676505f5ce6c621d8c28958d600dcf92bcf76574'/>
<id>676505f5ce6c621d8c28958d600dcf92bcf76574</id>
<content type='text'>
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 &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;swarren@nvidia.com&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>FIX: fat: Provide correct return code from disk_{read|write} to upper layers</title>
<updated>2015-09-11T21:15:21+00:00</updated>
<author>
<name>Łukasz Majewski</name>
<email>l.majewski@samsung.com</email>
</author>
<published>2015-09-03T12:21:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0a04ed86cfaa36d93d55016d0b3dc3f06352a2fe'/>
<id>0a04ed86cfaa36d93d55016d0b3dc3f06352a2fe</id>
<content type='text'>
It is very common that FAT code is using following pattern:
if (disk_{read|write}() &lt; 0)
        return -1;

Up till now the above code was dead, since disk_{read|write) could only
return value &gt;= 0.
As a result some errors from medium layer (i.e. eMMC/SD) were not caught.

The above behavior was caused by block_{read|write|erase} declared at
struct block_dev_desc (@part.h). It returns unsigned long, where 0
indicates error and &gt; 0 indicates that medium operation was correct.

This patch as error regards 0 returned from block_{read|write|erase}
when nr_blocks is grater than zero. Read/Write operation with nr_blocks=0
should return 0 and hence is not considered as an error.

Signed-off-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;

Test HW: Odroid XU3 - Exynos 5433
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is very common that FAT code is using following pattern:
if (disk_{read|write}() &lt; 0)
        return -1;

Up till now the above code was dead, since disk_{read|write) could only
return value &gt;= 0.
As a result some errors from medium layer (i.e. eMMC/SD) were not caught.

The above behavior was caused by block_{read|write|erase} declared at
struct block_dev_desc (@part.h). It returns unsigned long, where 0
indicates error and &gt; 0 indicates that medium operation was correct.

This patch as error regards 0 returned from block_{read|write|erase}
when nr_blocks is grater than zero. Read/Write operation with nr_blocks=0
should return 0 and hence is not considered as an error.

Signed-off-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;

Test HW: Odroid XU3 - Exynos 5433
</pre>
</div>
</content>
</entry>
</feed>
