[-next] btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR
diff mbox series

Message ID 1548381009-80383-1-git-send-email-yuehaibing@huawei.com
State New
Headers show
Series
  • [-next] btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR
Related show

Commit Message

YueHaibing Jan. 25, 2019, 1:50 a.m. UTC
Change the call to PTR_ERR to access the value just tested by IS_ERR.

Fixes: 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/qgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Qu Wenruo Jan. 25, 2019, 1:59 a.m. UTC | #1
On 2019/1/25 上午9:50, YueHaibing wrote:
> Change the call to PTR_ERR to access the value just tested by IS_ERR.
> 
> Fixes: 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  fs/btrfs/qgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 8559ed9..16d7ec8 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -3931,7 +3931,7 @@ int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans,
>  				   block->reloc_generation, block->level,
>  				   &block->first_key);
>  	if (IS_ERR(reloc_eb)) {
> -		ret = PTR_ERR(subv_eb);
> +		ret = PTR_ERR(reloc_eb);

Nice catch.

I'll fold the this fix in my original patch if it's OK for you.

Thanks,
Qu

>  		reloc_eb = NULL;
>  		goto free_out;
>  	}
> 
> 
>
YueHaibing Jan. 26, 2019, 1:37 a.m. UTC | #2
On 2019/1/25 9:59, Qu Wenruo wrote:
> 
> 
> On 2019/1/25 上午9:50, YueHaibing wrote:
>> Change the call to PTR_ERR to access the value just tested by IS_ERR.
>>
>> Fixes: 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  fs/btrfs/qgroup.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
>> index 8559ed9..16d7ec8 100644
>> --- a/fs/btrfs/qgroup.c
>> +++ b/fs/btrfs/qgroup.c
>> @@ -3931,7 +3931,7 @@ int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans,
>>  				   block->reloc_generation, block->level,
>>  				   &block->first_key);
>>  	if (IS_ERR(reloc_eb)) {
>> -		ret = PTR_ERR(subv_eb);
>> +		ret = PTR_ERR(reloc_eb);
> 
> Nice catch.
> 
> I'll fold the this fix in my original patch if it's OK for you.

Ok, sure.

> 
> Thanks,
> Qu
> 
>>  		reloc_eb = NULL;
>>  		goto free_out;
>>  	}
>>
>>
>>
>

Patch
diff mbox series

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 8559ed9..16d7ec8 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -3931,7 +3931,7 @@  int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans,
 				   block->reloc_generation, block->level,
 				   &block->first_key);
 	if (IS_ERR(reloc_eb)) {
-		ret = PTR_ERR(subv_eb);
+		ret = PTR_ERR(reloc_eb);
 		reloc_eb = NULL;
 		goto free_out;
 	}