diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-02-28 15:00:59 -0500 |
---|---|---|
committer | Josef Bacik <josef@toxicpanda.com> | 2020-02-28 16:46:00 -0500 |
commit | 4202997339f8dda55ed2250d4f985de5384c10b0 (patch) | |
tree | dc2c5d5aa230225284c2d61418efeab7858a587a | |
parent | 1e2d2400f3b5322e23ef819913ba79fef9dde7da (diff) | |
download | btrfs-next-4202997339f8dda55ed2250d4f985de5384c10b0.tar.gz |
btrfs: run clean_dirty_subvols if we fail to start a trans
If we do merge_reloc_roots() we could insert a few roots onto the dirty
subvol roots list, where we hold a ref on them. If we fail to start the
transaction we need to run clean_dirty_subvols() in order to cleanup the
refs.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
-rw-r--r-- | fs/btrfs/relocation.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index f42589cb351c2..e60450c444063 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4275,6 +4275,7 @@ restart: /* get rid of pinned extents */ trans = btrfs_join_transaction(rc->extent_root); if (IS_ERR(trans)) { + clean_dirty_subvols(rc); err = PTR_ERR(trans); goto out_free; } @@ -4701,6 +4702,7 @@ int btrfs_recover_relocation(struct btrfs_root *root) trans = btrfs_join_transaction(rc->extent_root); if (IS_ERR(trans)) { + clean_dirty_subvols(rc); err = PTR_ERR(trans); goto out_free; } |