--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/uffs/-/cxZDWWRY_8wJ.
To post to this group, send email to uf...@googlegroups.com.
To unsubscribe from this group, send email to uffs+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/uffs?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/uffs/-/9dsROJ6EtBgJ.
Hi Fred,No, deleting a file is not atomic.When deleting a file, UFFS chops file block by block from the end of file, until all blocks are been erased.I think we can turn this into atomic by reverse the order - erase head block (FILE block) first, and the rest of the file. If interrupted,the rest of blocks will become 'orphan' and will be erased in next mount.Will do the change soon.- Ricky
2012/1/12 Frédéric SERGENT <fred.se...@gmail.com>
Hi Ricky,
this calls another question from my side: renaming is atomic, but I think delete is not, right? According to tests I have made, if I get a reset in the middle of a uffs_delete, I get a truncated file. Is this a normal behaviour, or did I do something wrong?
Thanks,
Fred
Le mardi 10 janvier 2012 21:11:12 UTC+1, Ricky Zheng a écrit :
Hi Fred,
Renaming a file is atomic, just like modifying any part of the file. Renaming a file does not change file serial number (which is the link between the FILE node and the rest of the DATA node), it only flushing a single block, which is safe from any accidental power cuts.
Regards,
Ricky
2012/1/11 Frédéric SERGENT <fred....@gmail.com>
Hello Ricky,
I have a question regarding file renaming atomicity in UFFS.
We are implementing a mechanism (above UFFS:-)) involving the creation of a temporary file, that we have to rename once we are sure of its content.
I would like to know how sure and atomic the renaming of a file is: my understanding is that renaming a file involves a flush of its first block because the info we are changing have to be in the first page of the first block. So, if a reset or a power down occurs while renaming the file, we might be in the middle of copying the content of the first block (i.e. all the pages containing data).
So, my question is: how safe is it to do this? How does UFFS handle that kind of situation: when remounting, is there a risk that the new block might be seen as the proper beginning of the file, and that the data in it might be not totally written and thus, the file corrupted?
Thanks in advance,
Fred
To post to this group, send email to uf...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/uffs/-/cxZDWWRY_8wJ.
To unsubscribe from this group, send email to uffs+...@googlegroups.com.
...
We are implementing a mechanism (above UFFS:-)) involving the creation of a temporary file, that we have to rename once we are sure of its content....
Hi Fred,No, deleting a file is not atomic.When deleting a file, UFFS chops file block by block from the end of file, until all blocks are been erased.I think we can turn this into atomic by reverse the order - erase head block (FILE block) first, and the rest of the file. If interrupted,the rest of blocks will become 'orphan' and will be erased in next mount.Will do the change soon.