[Yaffs] yaffs_iterate + readdir + unlink

Top Page
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Andre Renaud
To: yaffs
Subject: [Yaffs] yaffs_iterate + readdir + unlink
I'm re-investigating an old issue that we're still seeing, earlier
discussed here:
and I think it's the same issue discussed here:

This is causing the bonnie++ tool to fail on Yaffs. I've traced it
down to an issue when combining the yaffs_iterate callback with
unlink. yaffs_iterate can be called with a start offset, and all the
files up to that point are skipped. However Bonnie++ uses readdir
+unlink, so it iterates over all items in the directory, unlinking
them. It does this in chunks, and each time it moves onto a new chunk,
it uses the offset at the end of the last chunk. But under the hood
YAFFS has been told to delete files from the directory, and as such
the offsets are now incorrect.

I think that inside yaffs_remove_obj_callback we should be checking if
the removed object has already been emitted by an in-progress search,
in which case we need to decrement the search position.

Any thoughts on this?