Skip to contentSkip to conversation

btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jan 31, 2019 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow

The proper pointer to be passed as argument is reloc_eb.

This bug was detected with the help of Coccinelle.

Fixes 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
---
 fs/btrfs/qgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/qgroup.c +1 -1
index 8559ed92d708..16d7ec8e4a06 100644
@@ -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;
 	}
Signature · 1 line
2.20.1
#1 lore raw
Quoted 17 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow

The proper pointer to be passed as argument is reloc_eb.

This bug was detected with the help of Coccinelle.

Fixes 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
---
 fs/btrfs/qgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/qgroup.c +0 -0
index 8559ed92d708..16d7ec8e4a06 100644

fs/btrfs/qgroup.c int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans, · line 3934

Quoted 5 lines
fs/btrfs/qgroup.c +1 -1
@@ -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);

Thanks, this was reported and fixed but the change has not propagated to for-next yet.

#2 lore raw
Quoted 13 lines · David Sterba
Quoted 12 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow

The proper pointer to be passed as argument is reloc_eb.

This bug was detected with the help of Coccinelle.

Fixes 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance")
---
 fs/btrfs/qgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

fs/btrfs/qgroup.c int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans, · line 3934

Quoted 10 lines
fs/btrfs/qgroup.c +1 -1
index 8559ed92d708..16d7ec8e4a06 100644
@@ -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);

Thanks, this was reported and fixed but the change has not propagated to for-next yet.

Great. Good to know it is fixed now.

Thanks
--
Gustavo