On 6/6/17 7:45 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osan...@fb.com>
> 
> Catch any future/remaining leaks or underflows of total_bytes_pinned.
> 
> Signed-off-by: Omar Sandoval <osan...@fb.com>
> ---
>  fs/btrfs/extent-tree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 75ad24f8d253..5fb2fb27eda6 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -9860,6 +9860,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
>                           space_info->bytes_reserved > 0 ||
>                           space_info->bytes_may_use > 0))
>                       dump_space_info(info, space_info, 0, 0);
> +             WARN_ON(percpu_counter_sum(&space_info->total_bytes_pinned) != 
> 0);
>               list_del(&space_info->list);
>               for (i = 0; i < BTRFS_NR_RAID_TYPES; i++) {
>                       struct kobject *kobj;
> 

Can we group this in with the other WARN_ON and add printing
total_bytes_pinned to dump_space_info?  Understanding the magnitude and
whether we're underflowed or haven't released enough is helpful.  While
testing your patchset, I did this and it found a few bugs in cleanup
after error.  I'll post those patches shortly.

-Jeff

-- 
Jeff Mahoney
SUSE Labs

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to