mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
btrfs: don't get an EINTR during drop_snapshot for reloc
commit18d3bff411
upstream. This was partially fixed byf3e3d9cc35
("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:f3e3d9cc35
("btrfs: avoid possible signal interruption of btrfs_drop_snapshot() on relocation tree") CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d9deb4ccd0
commit
9e2fc8f10c
1 changed files with 9 additions and 1 deletions
|
@ -5571,7 +5571,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc)
|
|||
goto out_free;
|
||||
}
|
||||
|
||||
trans = btrfs_start_transaction(tree_root, 0);
|
||||
/*
|
||||
* Use join to avoid potential EINTR from transaction
|
||||
* start. See wait_reserve_ticket and the whole
|
||||
* reservation callchain.
|
||||
*/
|
||||
if (for_reloc)
|
||||
trans = btrfs_join_transaction(tree_root);
|
||||
else
|
||||
trans = btrfs_start_transaction(tree_root, 0);
|
||||
if (IS_ERR(trans)) {
|
||||
err = PTR_ERR(trans);
|
||||
goto out_free;
|
||||
|
|
Loading…
Reference in a new issue