]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix deadlock with freeze and sync V2
authorJosef Bacik <jbacik@fusionio.com>
Fri, 24 Aug 2012 18:53:03 +0000 (12:53 -0600)
committerChris Mason <chris.mason@oracle.com>
Tue, 28 Aug 2012 20:53:40 +0000 (16:53 -0400)
commit03898ca915a52f4bdbf76f8f2e5c7d4691a08f73
tree939b10227537908c96bb339a1655a0c25413057b
parenta5ae1287ffb4c68b2dae4c3370918cf9275f9188
Btrfs: fix deadlock with freeze and sync V2

We can deadlock with freeze right now because we unconditionally start a
transaction in our ->sync_fs() call.  To fix this just check and see if we
have a running transaction to commit.  This saves us from the deadlock
because at this point we'll have the umount sem for the sb so we're safe
from freezes coming in after we've done our check.  With this patch the
freeze xfstests no longer deadlocks.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/super.c