Subject: kern/28673: pages allocated by genfs_getpages() prematurely written to disk
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <dyoung@netbsd.org>
List: netbsd-bugs
Date: 12/15/2004 23:24:00
>Number:         28673
>Category:       kern
>Synopsis:       pages allocated by genfs_getpages() prematurely written to disk
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 15 23:24:00 +0000 2004
>Originator:     David Young
>Release:        NetBSD 2.0
>Organization:
NetBSD
>Environment:
>Description:
According to Charles Hannum, genfs_getpages() may allow pages to be written
out before there is data in them.  He says on icb,

    genfs_getpages() is used to allocate new blocks.  Note it clears PG_CLEAN
    *and may unlock the pages, allowing them to be written out before there is
    actual data in them*.

Further, Charles says,

    This is probably why Dan (Carosone) sees zeroed blocks instead of data.

Even worse, there is a systematic problem with the Unified Buffer Cache (UBC),

    ... there are too many places where PG_CLEAN is maintained, and often far
    from where a page is actually modified ...  That's part of the problem
    with genfs_getpages().

>How-To-Repeat:
Code inspection.
>Fix: