Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e84cc142 authored by Filipe David Borba Manana's avatar Filipe David Borba Manana Committed by Chris Mason
Browse files

Btrfs: don't leak block group on error



In extent-tree.c:btrfs_write_dirty_block_groups(), if the call to
write_one_cache_group() failed, we would return without putting
the block group first.

Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 9b199859
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3317,10 +3317,9 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
		last = cache->key.objectid + cache->key.offset;

		err = write_one_cache_group(trans, root, path, cache);
		btrfs_put_block_group(cache);
		if (err) /* File system offline */
			goto out;

		btrfs_put_block_group(cache);
	}

	while (1) {