]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't call btrfs_start_delalloc_roots in flushoncommit
authorJosef Bacik <josef@toxicpanda.com>
Thu, 19 Oct 2017 18:16:01 +0000 (14:16 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Nov 2017 19:45:35 +0000 (20:45 +0100)
commitae4ea1c5c0186b460ec80c6a8dadd9b1b30e2f48
tree22c6c34e55ce1dabf8ca7d5d81205828f387ea51
parent5a4dec7ecf38f75e31a962ad31a7e505659167ed
btrfs: don't call btrfs_start_delalloc_roots in flushoncommit

We're holding the sb_start_intwrite lock at this point, and doing async
filemap_flush of the inodes will result in a deadlock if we freeze the
fs during this operation.  This is because we could do a
btrfs_join_transaction() in the thread we are waiting on which would
block at sb_start_intwrite, and thus deadlock.  Using
writeback_inodes_sb() side steps the problem by not introducing all of
these extra locking dependencies.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/transaction.c