]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: open code end_buffer_async_write in xfs_finish_page_writeback
authorChristoph Hellwig <hch@lst.de>
Sun, 17 Sep 2017 21:06:30 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:32:04 +0000 (07:32 -0500)
commit0b969d67682679a839f1df448be6764053b5ec2d
treeba338579d46b345f19ce9e7fe28f362eeb376cd4
parenta11ba10d909e1ae7b0f652354749ccd12d05837e
xfs: open code end_buffer_async_write in xfs_finish_page_writeback

BugLink: http://bugs.launchpad.net/bugs/1718412
commit 8353a814f2518dcfa79a5bb77afd0e7dfa391bb1 upstream.

Our loop in xfs_finish_page_writeback, which iterates over all buffer
heads in a page and then calls end_buffer_async_write, which also
iterates over all buffers in the page to check if any I/O is in flight
is not only inefficient, but also potentially dangerous as
end_buffer_async_write can cause the page and all buffers to be freed.

Replace it with a single loop that does the work of end_buffer_async_write
on a per-page basis.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/xfs/xfs_aops.c