Re: [PATCH 1/3] Btrfs: fix memory patcher through fs_info->qgroup_ulist

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

 



Hello Jan

> Commit 5b7c665e introduced fs_info->qgroup_ulist, that is allocated during
> btrfs_read_qgroup_config and meant to be used later by the qgroup accounting
> code. However, it is always freed before btrfs_read_qgroup_config returns,
> becuase the commit mentioned above adds a check for (ret), where a check
> for (ret < 0) would have been the right choice. This commit fixes the check.
> 
> Cc: Wang Shilong <wangsl-fnst@xxxxxxxxxxxxxx>
> Signed-off-by: Jan Schmidt <list.btrfs@xxxxxxxxxxxxx>
> ---
> fs/btrfs/qgroup.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index d059d86..74b432d 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -430,7 +430,7 @@ out:
> 	}
> 	btrfs_free_path(path);
> 
> -	if (ret)
> +	if (ret < 0)
> 		ulist_free(fs_info->qgroup_ulist);
> 

Looks good to me ,thanks very much for fixing this issue!

Thanks,
Wang

> 	return ret < 0 ? ret : 0;
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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