Hello Pawel
Thank you for investigating this further.
When you do rename with an existing target, the existing file will still exist while yaffs thinks the file is open. In the case of Linux, this means that yaffs still thinks there is an inode open for the file.
The same sort of thing happens if you do something like:
f = open("filename"...)
unlink("filename");
read/write f can continue.
The file will continue to exist and the file handles will still work (ie. you can continue to read/write the file). You obviously cannot open the file again because there is no directorym entry for the file. You can, however, still create new handles with dup() etc.
However as soon as you close the last handle to the file it will be released.
I cannot look at this for a few days, but if you could have a bit more of a look that would be great.
Thanks
Charles