Răsfoiți Sursa

Btrfs: fix deadlock with free space handling and user transactions

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>
Sage Weil 15 ani în urmă
părinte
comite
dd7e0b7b02
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      fs/btrfs/extent-tree.c

+ 1 - 1
fs/btrfs/extent-tree.c

@@ -3168,7 +3168,7 @@ alloc:
 		spin_unlock(&data_sinfo->lock);
 		spin_unlock(&data_sinfo->lock);
 
 
 		/* commit the current transaction and try again */
 		/* commit the current transaction and try again */
-		if (!committed) {
+		if (!committed && !root->fs_info->open_ioctl_trans) {
 			committed = 1;
 			committed = 1;
 			trans = btrfs_join_transaction(root, 1);
 			trans = btrfs_join_transaction(root, 1);
 			if (!trans)
 			if (!trans)