]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: make sure to flush queued bios if write_cache_pages waits
authorChris Mason <chris.mason@oracle.com>
Tue, 1 Nov 2011 14:08:06 +0000 (10:08 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:48 +0000 (21:20 -0500)
commitbb81236a98f279543d48cf9be98262ffd5f21c84
treef5192297fcef8552d4a565f67dbc089282c89bbd
parent56f22e2da8ab03da5d6dbb06cf5c53559ce0531c
Btrfs: make sure to flush queued bios if write_cache_pages waits

write_cache_pages tries to build up a large bio to stuff down the pipe.
But if it needs to wait for a page lock, it needs to make sure and send
down any pending writes so we don't deadlock with anyone who has the
page lock and is waiting for writeback of things inside the bio.

Dave Sterba triggered this as a deadlock between the autodefrag code and
the extent write_cache_pages

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 01d658f2ca3c85c1ffb20b306e30d16197000ce7)
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h