uffs_TruncateObject issue

53 ogledov
Preskoči na prvo neprebrano sporočilo

Savin Zlobec

neprebran,
4. apr. 2013, 05:13:524. 4. 13
do uf...@googlegroups.com
Hi,

there is a small typo in do_TruncateObject:

> Index: uffs/src/uffs_fs.c
> ===================================================================
> --- uffs/src/uffs_fs.c (revision 2536)
> +++ uffs/src/uffs_fs.c (working copy)
> @@ -1478,7 +1478,7 @@
> goto ext;
> }
>
> - if (remain >= fnode->u.file.len) {
> + if (remain == fnode->u.file.len) {
> goto ext; //!< nothing to do ...
> }

due to this uffs_TruncateObject doesn't work when using it to increase
(fill with '\0') file size up to 'remain' arg.

Regards.

Ricky Zheng

neprebran,
4. apr. 2013, 07:07:364. 4. 13
do uf...@googlegroups.com
Thanks Savin, will fix it.



--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uffs+uns...@googlegroups.com.
To post to this group, send email to uf...@googlegroups.com.
Visit this group at http://groups.google.com/group/uffs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Holger Fürstenberger

neprebran,
30. maj 2014, 20:21:1730. 5. 14
do uffs googlegroups.com
/**
 * Read page data to buf (do ECC error correction if needed)
 * \param[in] dev uffs device
 * \param[in] block flash block num
 * \param[in] page flash page num of the block
 * \param[out] buf holding the read out data
 * \param[in] skip_ecc skip ecc when reading data from flash
 *
 * \return #UFFS_FLASH_NO_ERR: success and/or has no flip bits.
 * #UFFS_FLASH_IO_ERR: I/O error, expect retry ?
 * #UFFS_FLASH_ECC_FAIL: spare data has flip bits and ecc correct failed.
 * #UFFS_FLASH_ECC_OK: spare data has flip bits and corrected by ecc.
 * #UFFS_FLASH_CRC_ERR: CRC verification failed.
 * #UFFS_FLASH_UNKNOWN_ERR:
 *
 * \note if skip_ecc is U_TRUE, skip CRC as well.
 */
int uffs_FlashReadPage(uffs_Device *dev, int block, int page, uffs_Buf *buf, UBOOL skip_ecc)
{
.....

.....
#ifdef CONFIG_ENABLE_PAGE_DATA_CRC
if (!skip_ecc && ret == UFFS_FLASH_ECC_OK) {
// There are bit flips, do CRC check again.
if (HEADER(buf)->crc == uffs_crc16sum(buf->data, size - sizeof(struct uffs_MiniHeaderSt))) {
ret = UFFS_FLASH_CRC_ERR;
goto ext;
}
}
#endif
.....

}


Version 1.3.6 Line 555:
if (HEADER(buf)->crc == uffs_crc16sum(buf->data, size - sizeof(struct uffs_MiniHeaderSt))) 

Do we not need a "!=" compare ? 

Best regards

Holger

Ingenieurbüro Embedded

Ingenieurbüro Embedded
Dipl-Ing. Holger Fürstenberger
Kriegsstrasse 262
76135 Karlsruhe-Germany 

phone: +49-721-915667-27

fax    : +49-721-915667-28
mobile: +49-170-9812014

h...@ib-embedded.de
www.ib-embedded.de


Die in dieser E-Mail beinhaltete Information oder Anlagen zu dieser E-Mail (im Folgenden „Mitteilung“) können privilegiert, vertraulich oder nach dem Gesetz geheime Informationen enthalten. Sie sind ausschließlich für den genannten Empfänger bestimmt, an den sie gerichtet sind. Falls Sie nicht der genannte Empfänger oder einer seiner Angestellten oder Mitarbeiter sind, oder diese Mitteilung irrtümlich erhalten haben, bitten wir Sie, uns unverzüglich darüber in Kenntnis zu setzen und diese Mitteilung sowie alle bestehenden Kopien dieser Mitteilung zu vernichten. Wir weisen Sie darauf hin, dass das Lesen, Weiterleiten, Verbreiten oder Kopieren dieser Mitteilung ohne die Zustimmung des Absenders verboten ist.

The information contained in this E-Mail or any of its attachments (in the following “message”) may be privileged, confidential or exempt from disclosure under applicable law. This message may be read, copied and used only by the intended recipient. If the reader of this message is not the intended recipient, or the employee or a person responsible for delivering it to the person addressed or if you have received this message by mistake, please immediately notify us and delete this message as well as all copies. The reading, disclosure, reproduction, distribution or any other dissemination or use of this message is strictly prohibited without the express permission of the sender.

Ricky Zheng

neprebran,
30. maj 2014, 20:22:5430. 5. 14
do uf...@googlegroups.com
Hi Holger,

Yes you just spotted a bug ! it should be ‘!=‘.

Thanks,
Ricky.

--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uffs+uns...@googlegroups.com.
To post to this group, send email to uf...@googlegroups.com.
Visit this group at http://groups.google.com/group/uffs.
For more options, visit https://groups.google.com/d/optout.

Odgovori vsem
Odgovori avtorju
Posreduj
0 novih sporočil