Add btrfs_end_transaction_throttle to force writers to wait for pending commits

The existing throttle mechanism was often not sufficient to prevent
new writers from coming in and making a given transaction run forever.
This adds an explicit wait at the end of most operations so they will
allow the current transaction to close.

There is no wait inside file_write, inode updates, or cow filling, all which
have different deadlock possibilities.

This is a temporary measure until better asynchronous commit support is
added.  This code leads to stalls as it waits for data=ordered
writeback, and it really needs to be fixed.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-06-25 16:01:31 -04:00
parent 333db94cdd
commit 89ce8a63d0
7 changed files with 55 additions and 59 deletions

View File

@@ -164,7 +164,6 @@ fail:
ret = err;
fail_commit:
btrfs_btree_balance_dirty(root, nr);
btrfs_throttle(root);
return ret;
}
@@ -206,7 +205,6 @@ static int create_snapshot(struct btrfs_root *root, char *name, int namelen)
fail_unlock:
btrfs_btree_balance_dirty(root, nr);
btrfs_throttle(root);
return ret;
}