• D
    xfs: page type check in writeback only checks last buffer · 6ffc4db5
    Dave Chinner 提交于
    xfs_is_delayed_page() checks to see if a page has buffers matching
    the given IO type passed in. It does so by walking the buffer heads
    on the page and checking if the state flags match the IO type.
    
    However, the "acceptable" variable that is calculated is overwritten
    every time a new buffer is checked. Hence if the first buffer on the
    page is of the right type, this state is lost if the second buffer
    is not of the correct type. This means that xfs_aops_discard_page()
    may not discard delalloc regions when it is supposed to, and
    xfs_convert_page() may not cluster IO as efficiently as possible.
    
    This problem only occurs on filesystems with a block size smaller
    than page size.
    
    Also, rename xfs_is_delayed_page() to xfs_check_page_type() to
    better describe what it is doing - it is not delalloc specific
    anymore.
    
    The problem was first noticed by Peter Watkins.
    Signed-off-by: NDave Chinner <dchinner@redhat.com>
    Reviewed-by: NChristoph Hellwig <hch@lst.de>
    Reviewed-by: NMark Tinguely <tinguely@sgi.com>
    Signed-off-by: NBen Myers <bpm@sgi.com>
    6ffc4db5
xfs_aops.c 37.3 KB