Re: Q: generic_file_write sets PG_locked???

Linus Torvalds (torvalds@transmeta.com)
Sat, 24 Apr 1999 09:51:20 -0700 (PDT)


On 24 Apr 1999, Eric W. Biederman wrote:
>
> Basically I contend that using PageLocked as a "data coherency lock"
> is broken, at least when using the generic code.

It _isn't_ a data coherency lock at all: it's really a data structure
coherency thing. Think of it as serialization protecting the internal
data structures, and protecting the filesystem layer from ever getting
confused about the order of reads and writes.

For example, a page cache entry always has to start out in a locked state,
so that when a write occurs, we can fill in the page without any reader
ever seeing the pre-write contents. If anybody was ever able to see those
contents, we'd have serious security holes. That's why the write logic has
to get the page lock early: not because of any real requirements for data
coherency, but for a more subtle reason.

Linus

-
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/