]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: fix race with freeze and free space inodes
authorJosef Bacik <jbacik@fusionio.com>
Fri, 14 Sep 2012 15:22:38 +0000 (11:22 -0400)
committerChris Mason <chris.mason@fusionio.com>
Thu, 4 Oct 2012 13:39:58 +0000 (09:39 -0400)
commit98114659e0d467e2c0ee6f24f2429329328fc312
tree6286d0eb87f22cc51a6f38503f6e82beb5fc0dfd
parent6bbe3a9c805fcb8cd8d396dafd32078181a7cdd5
Btrfs: fix race with freeze and free space inodes

So we start our freeze, somebody comes in and does an fsync() on a file
where we have to commit a transaction for whatever reason, and we will
deadlock because the freeze is waiting on FS_FREEZE people to stop writing
to the file system, but the transaction is waiting for its free space inodes
to be written out, which are in turn waiting on sb_start_intwrite while
trying to write the file extents.  To fix this we'll just skip the
sb_start_intwrite() if we TRANS_JOIN_NOLOCK since we're being waited on by a
transaction commit so we're safe wrt to freeze and this will keep us from
deadlocking.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/transaction.c