<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bcm63xx/u-boot/fs/fat, branch master</title>
<subtitle>Broadcom-s U-Boot</subtitle>
<id>https://git.openwrt.org/project/bcm63xx/u-boot/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/bcm63xx/u-boot/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/'/>
<updated>2019-05-28T22:55:09Z</updated>
<entry>
<title>fs: fat: allocate a new cluster for root directory of fat32</title>
<updated>2019-05-28T22:55:09Z</updated>
<author>
<name>AKASHI Takahiro</name>
</author>
<published>2019-05-24T05:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=cd2d727fff7ea4c69db49d7ee63bd791f91acd26'/>
<id>urn:sha1:cd2d727fff7ea4c69db49d7ee63bd791f91acd26</id>
<content type='text'>
Contrary to fat12/16, fat32 can have root directory at any location
and its size can be expanded.
Without this patch, root directory won't grow properly and so we will
eventually fail to add files under root directory. Please note that this
can happen even if you delete many files as deleted directory entries
are not reclaimed but just marked as "deleted" under the current
implementation.

Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Tested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>fs: fat: flush a directory cluster properly</title>
<updated>2019-05-28T22:55:08Z</updated>
<author>
<name>AKASHI Takahiro</name>
</author>
<published>2019-05-24T05:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=9c709c7b4177d063733070c7256f0b8635996d65'/>
<id>urn:sha1:9c709c7b4177d063733070c7256f0b8635996d65</id>
<content type='text'>
When a long name directory entry is created, multiple directory entries
may be occupied across a directory cluster boundary. Since only one
directory cluster is cached in a directory iterator, a first cluster must
be written back to device before switching over a second cluster.

Without this patch, some added files may be lost even if you don't see
any failures on write operation.

Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Tested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>fs: fat: write to non-cluster-aligned root directory</title>
<updated>2019-05-28T22:55:08Z</updated>
<author>
<name>AKASHI Takahiro</name>
</author>
<published>2019-05-24T05:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=a9f6706cf0ba330281ae7d6a0af65cc26ffb7d25'/>
<id>urn:sha1:a9f6706cf0ba330281ae7d6a0af65cc26ffb7d25</id>
<content type='text'>
With the commit below, fat now correctly handles a file read under
a non-cluster-aligned root directory of fat12/16.
Write operation should be fixed in the same manner.

Fixes: commit 9b18358dc05d ("fs: fat: fix reading non-cluster-aligned
       root directory")
Signed-off-by: AKASHI Takahiro &lt;takahiro.akashi@linaro.org&gt;
Cc: Anssi Hannula &lt;anssi.hannula@bitwise.fi&gt;
Tested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>fs: fat: Fix possible double free of fatbuf</title>
<updated>2019-05-28T17:57:52Z</updated>
<author>
<name>Andrew F. Davis</name>
</author>
<published>2019-05-16T14:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=d0cd30eb8137c0f14034aeb22c9f00cd70ccc98c'/>
<id>urn:sha1:d0cd30eb8137c0f14034aeb22c9f00cd70ccc98c</id>
<content type='text'>
fat_itr_root() allocates fatbuf so we free it on the exit path, if
the function fails we should not free it, check the return value
and skip freeing if the function fails.

Signed-off-by: Andrew F. Davis &lt;afd@ti.com&gt;
</content>
</entry>
<entry>
<title>fs: fat: correct file name normalization</title>
<updated>2019-05-28T17:57:52Z</updated>
<author>
<name>Heinrich Schuchardt</name>
</author>
<published>2019-05-12T07:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=7b437807ee0a051f46d329e868e0295299026b75'/>
<id>urn:sha1:7b437807ee0a051f46d329e868e0295299026b75</id>
<content type='text'>
File names may not contain control characters (&lt; 0x20).
Simplify the coding.

Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>fs: fat: fix reading non-cluster-aligned root directory</title>
<updated>2019-04-10T00:04:04Z</updated>
<author>
<name>Anssi Hannula</name>
</author>
<published>2019-02-27T10:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=9b18358dc05df1dc69c2274a61ec6bcf75a058ad'/>
<id>urn:sha1:9b18358dc05df1dc69c2274a61ec6bcf75a058ad</id>
<content type='text'>
A FAT12/FAT16 root directory location is specified by a sector offset and
it might not start at a cluster boundary. It also resides before the
data area (before cluster 2).

However, the current code assumes that the root directory is located at
a beginning of a cluster, causing no files to be found if that is not
the case.

Since the FAT12/FAT16 root directory is located before the data area
and is not aligned to clusters, using unsigned cluster numbers to refer
to the root directory does not work well (the "cluster number" may be
negative, and even allowing it be signed would not make it properly
aligned).

Modify the code to not use the normal cluster numbering when referring to
the root directory of FAT12/FAT16 and instead use a cluster-sized
offsets counted from the root directory start sector.

This is a relatively common case as at least the filesystem formatter on
Win7 seems to create such filesystems by default on 2GB USB sticks when
"FAT" is selected (cluster size 64 sectors, rootdir size 32 sectors,
rootdir starts at half a cluster before cluster 2).

dosfstools mkfs.vfat does not seem to create affected filesystems.

Signed-off-by: Anssi Hannula &lt;anssi.hannula@bitwise.fi&gt;
Reviewed-by: Bernhard Messerklinger &lt;bernhard.messerklinger@br-automation.com&gt;
Tested-by: Bernhard Messerklinger &lt;bernhard.messerklinger@br-automation.com&gt;
</content>
</entry>
<entry>
<title>fs: fat: fix link error when building with DEBUG=1</title>
<updated>2019-02-28T19:21:46Z</updated>
<author>
<name>Heinrich Schuchardt</name>
</author>
<published>2019-02-25T18:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=7274b7638a3ed03f64faff185253b2bccf557877'/>
<id>urn:sha1:7274b7638a3ed03f64faff185253b2bccf557877</id>
<content type='text'>
When compiling with DEBUG=1 an error
fs/fat/fat_write.c:831: undefined reference to `__aeabi_ldivmod'
occurred.

We should use do_div() instead of the modulus operator.

filesize and cur_pos cannot be negative. So let's use u64 to avoid
warnings.

Fixes: cb8af8af5ba0 ("fs: fat: support write with non-zero offset")
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>fs: fat: Reduce default max clustersize 64KiB from malloc pool</title>
<updated>2019-02-19T13:55:43Z</updated>
<author>
<name>Tien Fong Chee</name>
</author>
<published>2019-02-11T06:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=e48485f5e4f99811ba41e89f782a3f282f3c5a2e'/>
<id>urn:sha1:e48485f5e4f99811ba41e89f782a3f282f3c5a2e</id>
<content type='text'>
Release cluster block immediately when no longer use would help to reduce
64KiB memory allocated to the memory pool.

Signed-off-by: Tien Fong Chee &lt;tien.fong.chee@intel.com&gt;
</content>
</entry>
<entry>
<title>fs: fat: dynamically allocate memory for temporary buffer</title>
<updated>2019-02-19T13:55:43Z</updated>
<author>
<name>Tien Fong Chee</name>
</author>
<published>2019-02-11T06:56:19Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=8537874a6585251843f462c16b1684d38c887996'/>
<id>urn:sha1:8537874a6585251843f462c16b1684d38c887996</id>
<content type='text'>
Drop the statically allocated get_contents_vfatname_block and
dynamically allocate a buffer only if required. This saves
64KiB of memory.

Signed-off-by: Stefan Agner &lt;stefan.ag...@toradex.com&gt;
Signed-off-by: Tien Fong Chee &lt;tien.fong.chee@intel.com&gt;
</content>
</entry>
<entry>
<title>spl: fat/fs: Add option to include/exclude FAT write build in SPL</title>
<updated>2019-02-01T14:12:48Z</updated>
<author>
<name>Tien Fong Chee</name>
</author>
<published>2019-01-23T06:20:04Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=d8c3ea99826f652efa5e8843f7fb98dfd6f8d194'/>
<id>urn:sha1:d8c3ea99826f652efa5e8843f7fb98dfd6f8d194</id>
<content type='text'>
Most of the time SPL only needs very simple FAT reading, so having
CONFIG_IS_ENABLED(FAT_WRITE) to exclude it from SPL build would help
to save 64KiB default max clustersize from memory.

Signed-off-by: Tien Fong Chee &lt;tien.fong.chee@intel.com&gt;
Reviewed-by: Simon Goldschmidt &lt;simon.k.r.goldschmidt@gmail.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
</feed>
