<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/fat/fat_write.c, branch v2017.09</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/fs/fat/fat_write.c?h=v2017.09</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/fat/fat_write.c?h=v2017.09'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2017-08-26T18:56:07Z</updated>
<entry>
<title>fs: fat: fix fatwrite overflow calculation</title>
<updated>2017-08-26T18:56:07Z</updated>
<author>
<name>Reno Farnesi</name>
<email>nfarnesi4@gmail.com</email>
</author>
<published>2017-08-13T19:16:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=76216211f842677bac10000bfdbae1155172ddd6'/>
<id>urn:sha1:76216211f842677bac10000bfdbae1155172ddd6</id>
<content type='text'>
The overflow calculation was incorrect. Adding the start block of the
partition is not needed because the sectors are already relative to the
beginning of the partition. If you attempted to write a file smaller
than cur_part_info.start blocks on a full partition the old calculation
fails to catch the overflow. This would cause an infinite loop in the
determine_fatent function.

Old, incorrect calculation:

ending sector of new file = start sector + file size (in sectors)
last sector = partition start + total sectors on the partition

Adding the partition start block number is not needed because sectors
are already relative to the start of the partition.

New calculation:

ending sector of new file = start sector + file size (in sectors)
last sector = total sectors on the partition

Signed-off-by: Reno Farnesi &lt;nfarnesi4@gmail.com&gt;
</content>
</entry>
<entry>
<title>fs/fat: merge readwrite get_fatent_value() with readonly get_fatent()</title>
<updated>2016-12-27T16:24:14Z</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-12-16T23:27:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b8948d2aef80717d3d2c4f37ec086ce3ea5ad24f'/>
<id>urn:sha1:b8948d2aef80717d3d2c4f37ec086ce3ea5ad24f</id>
<content type='text'>
get_fatent_value(...) flushes changed FAT entries to disk when fetching
the next FAT blocks, in every other aspect it is identical to
get_fatent(...).

Provide a stub implementation for flush_dirty_fat_buffer if
CONFIG_FAT_WRITE is not set. Calling flush_dirty_fat_buffer during read
only operation is fine as it checks if any buffers needs flushing.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Benoît Thébaudeau &lt;benoit.thebaudeau.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>fs/fat: Avoid corruption of sectors following the FAT</title>
<updated>2016-12-27T16:24:13Z</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-12-16T23:27:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6c1a808052ba6a875df7aa450b6df4b199f3a281'/>
<id>urn:sha1:6c1a808052ba6a875df7aa450b6df4b199f3a281</id>
<content type='text'>
The FAT is read/flushed in segments of 6 (FATBUFBLOCKS) disk sectors. The
last segment may be less than 6 sectors, cap the length.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Benoît Thébaudeau &lt;benoit.thebaudeau.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>fat: fatwrite: fix the command for FAT12</title>
<updated>2016-12-27T16:24:13Z</updated>
<author>
<name>Philipp Skadorov</name>
<email>philipp.skadorov@savoirfairelinux.com</email>
</author>
<published>2016-12-15T20:52:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=49abbd9cc309235895c9ff7ccb6ad75c40fca4a9'/>
<id>urn:sha1:49abbd9cc309235895c9ff7ccb6ad75c40fca4a9</id>
<content type='text'>
The u-boot command fatwrite empties FAT clusters from the beginning
till the end of the file.
Specifically for FAT12 it fails to detect the end of the file and goes
beyond the file bounds thus corrupting the file system.

Additionally, FAT entry chaining-up into a file is not implemented
for FAT12.

The users normally workaround this by re-formatting the partition as
FAT16/FAT32, like here:
https://github.com/FEDEVEL/openrex-uboot-v2015.10/issues/1

The patch fixes the bounds of a file and FAT12 entries chaining into
a file, including EOF markup.

Signed-off-by: Philipp Skadorov &lt;philipp.skadorov@savoirfairelinux.com&gt;
</content>
</entry>
<entry>
<title>fs/fat/fatwrite: Local variable as buffer to store dir_slot entries</title>
<updated>2016-11-29T01:09:45Z</updated>
<author>
<name>Tien Fong Chee</name>
<email>tfchee@altera.com</email>
</author>
<published>2016-07-28T06:08:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7aa1a6b71c9af4651f6b3a164c84096a84d24285'/>
<id>urn:sha1:7aa1a6b71c9af4651f6b3a164c84096a84d24285</id>
<content type='text'>
fill_dir_slot use get_contents_vfatname_block as a temporary buffer for
constructing a list of dir_slot entries. To save the memory and providing
correct type of memory for above usage, a local buffer with accurate size
declaration is introduced.

The local array size 640 is used because for long file name entry,
each entry use 32 bytes, one entry can store up to 13 characters.
The maximum number of entry possible is 20. So, total size is
32*20=640bytes.

Signed-off-by: Genevieve Chan &lt;ccheauya@altera.com&gt;
Signed-off-by: Tien Fong Chee &lt;tfchee@altera.com&gt;
</content>
</entry>
<entry>
<title>fs/fat: Correct description of determine_fatent function</title>
<updated>2016-09-23T12:55:57Z</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-11T20:51:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ae1755be37e3d51af631ff2df12189c9fdc3e1d7'/>
<id>urn:sha1:ae1755be37e3d51af631ff2df12189c9fdc3e1d7</id>
<content type='text'>
Current description does not match the function behaviour.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
</entry>
<entry>
<title>fs/fat: Do not write unmodified fat entries to disk</title>
<updated>2016-09-23T12:55:56Z</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-11T20:51:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3c0ed9c3a561ca744b2b76921bb8352ba2340669'/>
<id>urn:sha1:3c0ed9c3a561ca744b2b76921bb8352ba2340669</id>
<content type='text'>
The code caches 6 sectors of the FAT. On FAT traversal, the old contents
needs to be flushed to disk, but only if any FAT entries had been modified.
Explicitly flag the buffer on modification.

Currently, creating a new file traverses the whole FAT up to the first
free cluster and rewrites the on-disk blocks.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
</content>
</entry>
<entry>
<title>fs/fat: Remove two statements without effect</title>
<updated>2016-09-23T12:55:55Z</updated>
<author>
<name>Stefan Brüns</name>
<email>stefan.bruens@rwth-aachen.de</email>
</author>
<published>2016-09-11T20:51:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ed76f912777066c788ae7e9cfb1d5e19e8c35274'/>
<id>urn:sha1:ed76f912777066c788ae7e9cfb1d5e19e8c35274</id>
<content type='text'>
fatlength is a local variable which is no more used after the assignment.
s_name is not used in the function, save the strncpy.

Signed-off-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Reviewed-by: Benoît Thébaudeau &lt;benoit.thebaudeau.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>Fix spelling of "supported/unsupported".</title>
<updated>2016-03-22T16:16:14Z</updated>
<author>
<name>Vagrant Cascadian</name>
<email>vagrant@debian.org</email>
</author>
<published>2016-03-15T19:11:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0af49b9575476587d7c0cfd79ba29a21aa50bc05'/>
<id>urn:sha1:0af49b9575476587d7c0cfd79ba29a21aa50bc05</id>
<content type='text'>
Signed-off-by: Vagrant Cascadian &lt;vagrant@debian.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Peter Griffin &lt;peter.griffin@linaro.org&gt;
</content>
</entry>
<entry>
<title>dm: block: Adjust device calls to go through helpers function</title>
<updated>2016-03-14T21:34:50Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-02-29T22:25:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2a981dc2c62c500110aad297fa70503aec36e689'/>
<id>urn:sha1:2a981dc2c62c500110aad297fa70503aec36e689</id>
<content type='text'>
To ease conversion to driver model, add helper functions which deal with
calling each block device method. With driver model we can reimplement these
functions with the same arguments.

Use inline functions to avoid increasing code size on some boards.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
</entry>
</feed>
