Re: ext2fs enhacement/fix [re: shrinking directories]

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Tue, 21 Jul 1998 10:34:33 +0200


> >>
> > The problem of this solution is (when done on mounted fs) that noone can
> be
> >reading the directory when we are replacing the old copy (dir->f_pos will
> be bad :() and
> >I'm not sure how often this is satisfied on a busy servers with big dirs...
>
>
> Perhaps not at the exact moment, but read request can be temporarily delayed
> for the short amount of time it would take to update the directory entry.
No. Everybody who started reading directory before our updating and haven't
closed the dir yet must read from the old copy. It's because he has for sure that
his DirFileStruct -> f_pos is pointing to an exact directory entry (and he
might have also saved another positions in file(directory)). For further details
see linux/fs/readdir.c and linux/fs/ext2/dir.c (or some other fs).
The solution of this problem is (as suggested in some other mail) to maintain
(for some time) two copies of directory but it can be a bit tricky and
it will need a lot of new code :(.

Bye Honza

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html