Re: how to write get_block?

Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz)
Fri, 8 Oct 1999 16:41:43 +0200 (CEST)


> On what? ITYM truncate(), right? Metadata doesn't end up in the page
> cache, so... ->flushpage() set to block_flushpage() should be OK, but it
> will not be enough. All stuff with truncate()/write() is racey right now,
> AFAICS. The next thing I'm going to do is a (dumb) implementation of
> blocking rwlocks. write() being reader and truncate() - writer.
>
> Oh, crap! Add

Doing flushpage is good thing. But there's another posibility of data
corruption.

You have a directory and change something in it - there are dirty hashed
buffers covering directory.

You erase that directory - as there is no bforget, there are still dirty
hashed buffers.

You alloc file at that place. Buffers containing former directory are
flushed over the file.

I think bforget must be called always when you release some structure that
was accessed using bread/brelse.

Mikulas Patocka

-
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.tux.org/lkml/