Re: memleaks in btrfs-devel/misc-next

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 08.01.20 um 01:31 schrieb Dennis Zhou:
[...]
> I believe it's because I forgot to put a reference in the relocation
> path. The below seems to fix it in my tests, but would you mind
> verifying?


Thanks for the quick turn around.
Tested-by: Johannes Thumshirn <jth@xxxxxxxxxx>

@David can you fold this into
63c3d72cf65e ("btrfs: add the beginning of async discard, discard
workqueue")

> --
> From: Dennis Zhou <dennis@xxxxxxxxxx>
> Date: Tue, 7 Jan 2020 14:14:04 -0800
> Subject: [PATCH] btrfs: put lookup reference in btrfs_relocate_chunk()
>
> Async discard requires looking up the block_group in the relocation path
> to cancel any work items against it. However, I forgot to put the
> reference from btrfs_lookup_block_group().
>
> Reported-by: Johannes Thumshirn <jth@xxxxxxxxxx>
> Signed-off-by: Dennis Zhou <dennis@xxxxxxxxxx>
> ---
>  fs/btrfs/volumes.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 65e78e59d5c4..eb55df0d4038 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -2898,6 +2898,7 @@ static int btrfs_relocate_chunk(struct btrfs_fs_info *fs_info, u64 chunk_offset)
>  	if (!block_group)
>  		return -ENOENT;
>  	btrfs_discard_cancel_work(&fs_info->discard_ctl, block_group);
> +	btrfs_put_block_group(block_group);
>  
>  	trans = btrfs_start_trans_remove_block_group(root->fs_info,
>  						     chunk_offset);




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux