Re: [Yaffs] seekdir failure

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
CC: Anthony Ashfield
Subject: Re: [Yaffs] seekdir failure
On Tuesday 27 March 2007 03:30, Anthony Ashfield wrote:
> Hi all,
>
> My test with seekdir fails after a file in the directory is deleted. If I
> remove these lines inside yaffs_readdir, seekdir works:
>
>     if (f->f_version != inode->i_version) {
>         offset = 2;
>         f->f_pos = offset;
>         f->f_version = inode->i_version;
>     }

>
> This code rewinds the offset when a file in the directory is deleted and it
> breaks seekdir.


We had an interesting discussion when this code was added. IIRC, busybox broke
if these lines were not there. See
http://aleph1.co.uk/lurker/message/20051105.003401.0b8fec14.en.html

seekdir is a very problematic function as there is no formal definition for
how it should work, particularly wrt entries being added/deleted.

To quote from the seekdir manpage:
"The definition of seekdir() and telldir() does not specify whether, when
using these interfaces, a given directory entry will be seen at all, or more
than once. "

Since busybox is very important to most embedded systems, it is imperative
that its needs are met first.

If you can give more details of the problems you experience, and an example
that might help improve the situation for everybody.

-- CHarles