On Mon, 24 Jul 2000, Roman Zippel wrote:

> Hi,
> 
> While trying to get affs working again, I noticed that the current
> cont_prepare_write is hardly working, if you write to a file in steps of
> 1024, the bytes pointer is never updated resulting in an endless loop.

Testcase, please? It certainly seems to be working on FAT and HPFS -
both are using the same thing.

> Below is a fixed version, that also removes the bogus tricks to the
> bytes ptr. I also "fixed" the comment, any reason we have to be
> insulting like this?

Sheer frustration from the braindead design? _Nothing_ can insult persons
responsible for AFFS and FAT "designs". Sorry.

> Anyway, does anyone see a problem with the fix before I send it to
> Linus?

Yes. In particular, adding the whole PAGE_CACHE_SIZE to *bytes is
_definitely_ wrong. The whole "round up to the block boundary" thing is
there for purpose - in native environment all of these filesystems do not
care to clean the tail of the last allocated block. So we have to do it
for them. And we don't want to repeat such cleaning on _every_ write() -
the first one should normalize the situation.

If you have problems with affs_get_block() - feel free to ask, I probably
can help. What _is_ the problem? Notice that you can assume that
affs_get_block() will only have to create blocks immediately past the
end-of-file. Please, check fat_get_block() or hpfs_get_block() - they
seem to work. I don't claim that I didn't fsck up there, but I would
certainly like to hear more before I decide that I did.

If you need description of cont_... design - just ask.

Reply via email to