• David Howells's avatar
    netfs: Fix the loop that unmarks folios after writing to the cache · 807c6d09
    David Howells authored
    In the loop in netfs_rreq_unmark_after_write() that removes the PG_fscache
    from folios after they've been written to the cache, as soon as we remove
    the mark from a multipage folio, it can get split - and then we might see a
    fragment of folio again.
    
    Guard against this by advancing the 'unlocked' tracker to the index of the
    last page in the folio to avoid a double removal of the PG_fscache mark.
    Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    cc: Matthew Wilcox <willy@infradead.org>
    cc: linux-afs@lists.infradead.org
    cc: linux-cachefs@redhat.com
    cc: linux-fsdevel@vger.kernel.org
    cc: linux-mm@kvack.org
    807c6d09
io.c 22.5 KB