Skip to content

Commit 18d3bff

Browse files
josefbacikkdave
authored andcommitted
btrfs: don't get an EINTR during drop_snapshot for reloc
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]>
1 parent 518837e commit 18d3bff

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
@@ -5549,7 +5549,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc)
55495549
goto out_free;
55505550
}
55515551

5552-
trans = btrfs_start_transaction(tree_root, 0);
5552+
/*
5553+
* Use join to avoid potential EINTR from transaction
5554+
* start. See wait_reserve_ticket and the whole
5555+
* reservation callchain.
5556+
*/
5557+
if (for_reloc)
5558+
trans = btrfs_join_transaction(tree_root);
5559+
else
5560+
trans = btrfs_start_transaction(tree_root, 0);
55535561
if (IS_ERR(trans)) {
55545562
err = PTR_ERR(trans);
55555563
goto out_free;

0 commit comments

Comments
 (0)