Re: Q: generic_file_write sets PG_locked???

Trond Myklebust (trond.myklebust@fys.uio.no)
19 Apr 1999 12:48:38 +0200


ebiederm+eric@ccr.net (Eric W. Biederman) writes:

> I've been cleaning up my patches for generically handling dirty data in the page
> cache, in preparation for 2.3.
>
> I have noticed that someone has mangled generic_file_write.
> By:
> A) setting/clearing PG_lock when IO is not happening to a page.
> B) Not reading in a whole page (if necessary) before it writes a partial page.
> C) Not setting PG_uptodate after the data has been put in the page cache.
>
> This confuses, but doesn't break things in the 2.2.5 right now, and for 2.3
> is absolutely ridiculous.
>
> I am currenlty looking for why the code was changed to function this way,
> so I don't damage smbfs, and nfs too much as I correct this.
>

It happened somewhere after 2.1.74. I've already corrected it for the
NFS write-gathering code and smbfs in the 'ac' series since it gives a
downright bug in the NFS code (you copy onto a page before checking
whether it is being flushed or not). 'generic_file_write' should not
do anything other than the minimum required to call the lower level
routines.

NB: It should NOT set PG_lock, or PG_uptodate. Nor should it copy the
data. All these things should be done by the lower level.

The reason I haven't propagated my change to Linus' tree is 'cos I'm
loth to break anything else that uses generic_file_write: we are after
all in a stable release, so these interfaces are not supposed to
change.

Cheers,
Trond

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