summaryrefslogtreecommitdiff
path: root/fs/exofs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2017-10-13 16:47:45 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-27 08:38:10 (GMT)
commit245262c66d1d497cb11a9773aaad1d8504608d04 (patch)
tree098b942d5f6a6660efab8814c81b1ab7c5bf0582 /fs/exofs
parent67d73f4122a37781f2d5efc617c2e08061ad5358 (diff)
downloadlinux-245262c66d1d497cb11a9773aaad1d8504608d04.tar.xz
xfs: cancel dirty pages on invalidation
commit 793d7dbe6d82a50b9d14bf992b9eaacb70a11ce6 upstream. Recently we've had warnings arise from the vm handing us pages without bufferheads attached to them. This should not ever occur in XFS, but we don't defend against it properly if it does. The only place where we remove bufferheads from a page is in xfs_vm_releasepage(), but we can't tell the difference here between "page is dirty so don't release" and "page is dirty but is being invalidated so release it". In some places that are invalidating pages ask for pages to be released and follow up afterward calling ->releasepage by checking whether the page was dirty and then aborting the invalidation. This is a possible vector for releasing buffers from a page but then leaving it in the mapping, so we really do need to avoid dirty pages in xfs_vm_releasepage(). To differentiate between invalidated pages and normal pages, we need to clear the page dirty flag when invalidating the pages. This can be done through xfs_vm_invalidatepage(), and will result xfs_vm_releasepage() seeing the page as clean which matches the bufferhead state on the page after calling block_invalidatepage(). Hence we can re-add the page dirty check in xfs_vm_releasepage to catch the case where we might be releasing a page that is actually dirty and so should not have the bufferheads on it removed. This will remove one possible vector of "dirty page with no bufferheads" and so help narrow down the search for the root cause of that problem. Signed-Off-By: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/exofs')
0 files changed, 0 insertions, 0 deletions