Skip to content

Commit 9e2fc8f

Browse files
josefbacikgregkh
authored andcommitted
btrfs: don't get an EINTR during drop_snapshot for reloc
commit 18d3bff upstream. This was partially fixed by f3e3d9c ("btrfs: avoid possible signal interruption of btrfs_drop_snapshot() on relocation tree"), however it missed a spot when we restart a trans handle because we need to end the transaction. The fix is the same, simply use btrfs_join_transaction() instead of btrfs_start_transaction() when deleting reloc roots. Fixes: f3e3d9c ("btrfs: avoid possible signal interruption of btrfs_drop_snapshot() on relocation tree") CC: [email protected] # 5.4+ Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d9deb4c commit 9e2fc8f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/btrfs/extent-tree.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5571,7 +5571,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc)
55715571
goto out_free;
55725572
}
55735573

5574-
trans = btrfs_start_transaction(tree_root, 0);
5574+
/*
5575+
* Use join to avoid potential EINTR from transaction
5576+
* start. See wait_reserve_ticket and the whole
5577+
* reservation callchain.
5578+
*/
5579+
if (for_reloc)
5580+
trans = btrfs_join_transaction(tree_root);
5581+
else
5582+
trans = btrfs_start_transaction(tree_root, 0);
55755583
if (IS_ERR(trans)) {
55765584
err = PTR_ERR(trans);
55775585
goto out_free;

0 commit comments

Comments
 (0)