Frédéric SERGENT
unread,Feb 2, 2012, 4:59:43 AM2/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uf...@googlegroups.com
hi Ricky,
I am currently working with very recent changes taken from Git. I think there is a new issue in uffs_DeleteObject: in this version, there is a call to a new function, _CheckObjBufRef. I understand that it replaces the check of references counting on just the FILE or DIR buf by a check on all bufs related to the object. But in the previous version, the FILE or DIR block was then marked as UFFS_BUF_EMPTY. It does not anymore, leading to confusion when opening an object that reuses the same serial number, and thus, reuse one these blocks. Typically, I had a problem when creating a file right after deleting a directory: I found myself with a file that used a buffer typified as a directory, leading to fatal errors.
I just re-added these 2 lines:
(...)
if (_CheckObjBufRef(obj) > 0) {
if (err)
*err = UEACCES;
goto ext_lock;
}
uffs_Buf *buf = uffs_BufFind(dev, obj->parent, obj->serial, 0);
buf->mark = UFFS_BUF_EMPTY; //!< make this buffer expired.
node = obj->node;
(...)
Apparently, it solved my problem, but I am not sure if this is enough: if there is a need to check reference counting on all buf used by a file, maybe there is also a need to mark them all as UFFS_BUF_EMPTY?
Could you please have a look at this?
Thanks,
Fred