• David Howells's avatar
    afs: Fix afs_invalidatepage to adjust the dirty region · f86726a6
    David Howells authored
    Fix afs_invalidatepage() to adjust the dirty region recorded in
    page->private when truncating a page.  If the dirty region is entirely
    removed, then the private data is cleared and the page dirty state is
    cleared.
    
    Without this, if the page is truncated and then expanded again by truncate,
    zeros from the expanded, but no-longer dirty region may get written back to
    the server if the page gets laundered due to a conflicting 3rd-party write.
    
    It mustn't, however, shorten the dirty region of the page if that page is
    still mmapped and has been marked dirty by afs_page_mkwrite(), so a flag is
    stored in page->private to record this.
    
    Fixes: 4343d008 ("afs: Get rid of the afs_writeback record")
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    f86726a6
file.c 16.4 KB