diff mbox series

hfsplus: Fix code typo

Message ID 20220722195133.18730-1-gaoxin@cdjrlc.com (mailing list archive)
State New, archived
Headers show
Series hfsplus: Fix code typo | expand

Commit Message

Xin Gao July 22, 2022, 7:51 p.m. UTC
The double `free' is duplicated in line 498, remove one.

Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
---
 fs/hfsplus/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Bottomley July 22, 2022, 8:12 p.m. UTC | #1
On Sat, 2022-07-23 at 03:51 +0800, Xin Gao wrote:
> The double `free' is duplicated in line 498, remove one.
> 
> Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
> ---
>  fs/hfsplus/btree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
> index 66774f4cb4fd..655cf60eabbf 100644
> --- a/fs/hfsplus/btree.c
> +++ b/fs/hfsplus/btree.c
> @@ -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
Matthew Wilcox (Oracle) July 22, 2022, 9:32 p.m. UTC | #2
On Sat, Jul 23, 2022 at 03:51:33AM +0800, Xin Gao wrote:
> 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.

> Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
> ---
>  fs/hfsplus/btree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
> index 66774f4cb4fd..655cf60eabbf 100644
> --- a/fs/hfsplus/btree.c
> +++ b/fs/hfsplus/btree.c
> @@ -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);
> -- 
> 2.30.2
>
Harald Arnesen July 24, 2022, 10:48 a.m. UTC | #3
Matthew Wilcox [22/07/2022 23.32]:

> On Sat, Jul 23, 2022 at 03:51:33AM +0800, Xin Gao wrote:
>> 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 ")
diff mbox series

Patch

diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index 66774f4cb4fd..655cf60eabbf 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -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);