Skip to content

Commit f6322c7

Browse files
josefbaciksmb49
authored andcommitted
btrfs: don't get an EINTR during drop_snapshot for reloc
BugLink: https://bugs.launchpad.net/bugs/1915195 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]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: William Breathitt Gray <[email protected]>
1 parent 2310c44 commit f6322c7

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
@@ -5542,7 +5542,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
55425542
goto out_free;
55435543
}
55445544

5545-
trans = btrfs_start_transaction(tree_root, 0);
5545+
/*
5546+
* Use join to avoid potential EINTR from transaction
5547+
* start. See wait_reserve_ticket and the whole
5548+
* reservation callchain.
5549+
*/
5550+
if (for_reloc)
5551+
trans = btrfs_join_transaction(tree_root);
5552+
else
5553+
trans = btrfs_start_transaction(tree_root, 0);
55465554
if (IS_ERR(trans)) {
55475555
err = PTR_ERR(trans);
55485556
goto out_free;

0 commit comments

Comments
 (0)