Skip to content

Commit

Permalink
Btrfs: fix deadlock with free space handling and user transactions
Browse files Browse the repository at this point in the history
If an ioctl-initiated transaction is open, we can't force a commit during
the free space checks in order to free up pinned extents or else we
deadlock.  Just ENOSPC instead.

A more satisfying solution that reserves space for the entire user
transaction up front is forthcoming...

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Sage Weil authored and Chris Mason committed Sep 29, 2009
1 parent 1ab86ae commit dd7e0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,7 @@ int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode,
spin_unlock(&data_sinfo->lock);

/* commit the current transaction and try again */
if (!committed) {
if (!committed && !root->fs_info->open_ioctl_trans) {
committed = 1;
trans = btrfs_join_transaction(root, 1);
if (!trans)
Expand Down

0 comments on commit dd7e0b7

Please sign in to comment.