Skip to contentSkip to conversation

hfsplus: Fix code typo

PATCH In review Xin Gao 4 participants 4 messages Jul 22, 2022 – Jul 24, 2022

Subsystems (2)
lore
Share & tools
lore

Xin Gao

author
#0 lore raw

PATCH 1/1 hfsplus: Fix code typo

The double `free' is duplicated in line 498, remove one.

---
 fs/hfsplus/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/btree.c +1 -1
index 66774f4cb4fd..655cf60eabbf 100644
@@ -495,7 +495,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
 	m = 1 << (~nidx & 7);
 	byte = data[off];
 	if (!(byte & m)) {
-		pr_crit("trying to free free bnode "
+		pr_crit("trying to free bnode "
 				"%u(%d)\n",
 			node->this, node->type);
 		kunmap(page);
Signature · 1 line
2.30.2
#1 lore raw
Quoted 12 lines · Xin Gao

The double `free' is duplicated in line 498, remove one.

---
 fs/hfsplus/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/btree.c +0 -0
index 66774f4cb4fd..655cf60eabbf 100644

fs/hfsplus/btree.c void hfs_bmap_free(struct hfs_bnode *node) · line 498

Quoted 5 lines
fs/hfsplus/btree.c +1 -1
@@ -495,7 +495,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
 	m = 1 << (~nidx & 7);
 	byte = data[off];
 	if (!(byte & m)) {
-		pr_crit("trying to free free bnode "
+		pr_crit("trying to free bnode "

What makes you think this message needs correcting? The code seems to be checking whether we're freeing an already free bnode, meaning the message looks correct as is and the proposed change makes it incorrect.

James

#2 lore raw
In reply to Xin Gao
Quoted 1 line · Xin Gao

The double `free' is duplicated in line 498, remove one.

This is wrong. The intended meaning here is "trying to free bnode which is already free". Please don't send patches for code you don't understand.

Quoted 21 lines
---
 fs/hfsplus/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/btree.c +1 -1
index 66774f4cb4fd..655cf60eabbf 100644
@@ -495,7 +495,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
 	m = 1 << (~nidx & 7);
 	byte = data[off];
 	if (!(byte & m)) {
-		pr_crit("trying to free free bnode "
+		pr_crit("trying to free bnode "
 				"%u(%d)\n",
 			node->this, node->type);
 		kunmap(page);
Signature · 1 line
2.30.2
#3 lore raw

Matthew Wilcox [22/07/2022 23.32]:

Quoted 6 lines · Xin Gao
Quoted 1 line

The double `free' is duplicated in line 498, remove one.

This is wrong. The intended meaning here is "trying to free bnode which is already free". Please don't send patches for code you don't understand.

Perhaps inserting an "a" in the message would make it clearer? (pr_crit("trying to free a free bnode ")

Signature · 1 line
Hilsen Harald