* [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
@ 2024-04-11 8:29 Lukas Bulwahn
2024-04-11 9:16 ` Hongbo Li
2024-04-11 9:21 ` Hongbo Li
0 siblings, 2 replies; 7+ messages in thread
From: Lukas Bulwahn @ 2024-04-11 8:29 UTC (permalink / raw
To: Kent Overstreet, Brian Foster, linux-bcachefs
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
Commit ec9cc18fc2e6 ("bcachefs: Add checks for invalid snapshot IDs")
intends to check the sanity of a snapshot and panic when
BCACHEFS_DEBUG is set, but that conditional has a typo.
Fix the typo to refer to the actual existing Kconfig symbol.
This was found with ./scripts/checkkconfigsymbols.py.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
---
fs/bcachefs/snapshot.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/bcachefs/snapshot.h b/fs/bcachefs/snapshot.h
index b7d2fed37c4f..3fdb41b33d2d 100644
--- a/fs/bcachefs/snapshot.h
+++ b/fs/bcachefs/snapshot.h
@@ -77,7 +77,7 @@ static inline u32 __bch2_snapshot_parent(struct bch_fs *c, u32 id)
return 0;
u32 parent = s->parent;
- if (IS_ENABLED(CONFIG_BCACHEFS_DEBU) &&
+ if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) &&
parent &&
s->depth != snapshot_t(c, parent)->depth + 1)
panic("id %u depth=%u parent %u depth=%u\n",
--
2.44.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 8:29 [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG Lukas Bulwahn
@ 2024-04-11 9:16 ` Hongbo Li
2024-04-11 9:21 ` Hongbo Li
1 sibling, 0 replies; 7+ messages in thread
From: Hongbo Li @ 2024-04-11 9:16 UTC (permalink / raw
To: Lukas Bulwahn, Kent Overstreet, Brian Foster, linux-bcachefs
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
On 2024/4/11 16:29, Lukas Bulwahn wrote:
> Commit ec9cc18fc2e6 ("bcachefs: Add checks for invalid snapshot IDs")
> intends to check the sanity of a snapshot and panic when
> BCACHEFS_DEBUG is set, but that conditional has a typo.
>
> Fix the typo to refer to the actual existing Kconfig symbol.
>
> This was found with ./scripts/checkkconfigsymbols.py.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
> ---
> fs/bcachefs/snapshot.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/bcachefs/snapshot.h b/fs/bcachefs/snapshot.h
> index b7d2fed37c4f..3fdb41b33d2d 100644
> --- a/fs/bcachefs/snapshot.h
> +++ b/fs/bcachefs/snapshot.h
> @@ -77,7 +77,7 @@ static inline u32 __bch2_snapshot_parent(struct bch_fs *c, u32 id)
> return 0;
>
> u32 parent = s->parent;
> - if (IS_ENABLED(CONFIG_BCACHEFS_DEBU) &&
> + if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) &&
> parent &&
> s->depth != snapshot_t(c, parent)->depth + 1)
> panic("id %u depth=%u parent %u depth=%u\n",
Reviewed-by: Hongbo Li <lihongbo22@huawei.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 8:29 [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG Lukas Bulwahn
2024-04-11 9:16 ` Hongbo Li
@ 2024-04-11 9:21 ` Hongbo Li
2024-04-11 10:21 ` Dan Carpenter
2024-04-11 17:31 ` Kent Overstreet
1 sibling, 2 replies; 7+ messages in thread
From: Hongbo Li @ 2024-04-11 9:21 UTC (permalink / raw
To: Lukas Bulwahn, Kent Overstreet, Brian Foster, linux-bcachefs
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
Also, I am curious why such spelling errors cannot be detected at the
compilation stage.
On 2024/4/11 16:29, Lukas Bulwahn wrote:
> Commit ec9cc18fc2e6 ("bcachefs: Add checks for invalid snapshot IDs")
> intends to check the sanity of a snapshot and panic when
> BCACHEFS_DEBUG is set, but that conditional has a typo.
>
> Fix the typo to refer to the actual existing Kconfig symbol.
>
> This was found with ./scripts/checkkconfigsymbols.py.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
> ---
> fs/bcachefs/snapshot.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/bcachefs/snapshot.h b/fs/bcachefs/snapshot.h
> index b7d2fed37c4f..3fdb41b33d2d 100644
> --- a/fs/bcachefs/snapshot.h
> +++ b/fs/bcachefs/snapshot.h
> @@ -77,7 +77,7 @@ static inline u32 __bch2_snapshot_parent(struct bch_fs *c, u32 id)
> return 0;
>
> u32 parent = s->parent;
> - if (IS_ENABLED(CONFIG_BCACHEFS_DEBU) &&
> + if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) &&
> parent &&
> s->depth != snapshot_t(c, parent)->depth + 1)
> panic("id %u depth=%u parent %u depth=%u\n",
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 9:21 ` Hongbo Li
@ 2024-04-11 10:21 ` Dan Carpenter
2024-04-11 11:44 ` Hongbo Li
2024-04-11 17:31 ` Kent Overstreet
1 sibling, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2024-04-11 10:21 UTC (permalink / raw
To: Hongbo Li
Cc: Lukas Bulwahn, Kent Overstreet, Brian Foster, linux-bcachefs,
kernel-janitors, linux-kernel, Lukas Bulwahn
On Thu, Apr 11, 2024 at 05:21:05PM +0800, Hongbo Li wrote:
> Also, I am curious why such spelling errors cannot be detected at the
> compilation stage.
>
The IS_ENABLED() macro is testing whether the define exists or not.
In this case both "CONFIG_BCACHEFS_DEBUG" and "CONFIG_BCACHEFS_DEBU" do
not exist for this config.
Lukas's scripts make a list of macros we expect to exist and then checks
against the list.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 10:21 ` Dan Carpenter
@ 2024-04-11 11:44 ` Hongbo Li
0 siblings, 0 replies; 7+ messages in thread
From: Hongbo Li @ 2024-04-11 11:44 UTC (permalink / raw
To: Dan Carpenter
Cc: Lukas Bulwahn, Kent Overstreet, Brian Foster, linux-bcachefs,
kernel-janitors, linux-kernel, Lukas Bulwahn
Thanks, I got it!
On 2024/4/11 18:21, Dan Carpenter wrote:
> On Thu, Apr 11, 2024 at 05:21:05PM +0800, Hongbo Li wrote:
>> Also, I am curious why such spelling errors cannot be detected at the
>> compilation stage.
>>
>
> The IS_ENABLED() macro is testing whether the define exists or not.
> In this case both "CONFIG_BCACHEFS_DEBUG" and "CONFIG_BCACHEFS_DEBU" do
> not exist for this config.
>
> Lukas's scripts make a list of macros we expect to exist and then checks
> against the list.
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 9:21 ` Hongbo Li
2024-04-11 10:21 ` Dan Carpenter
@ 2024-04-11 17:31 ` Kent Overstreet
2024-04-12 1:35 ` Hongbo Li
1 sibling, 1 reply; 7+ messages in thread
From: Kent Overstreet @ 2024-04-11 17:31 UTC (permalink / raw
To: Hongbo Li
Cc: Lukas Bulwahn, Brian Foster, linux-bcachefs, kernel-janitors,
linux-kernel, Lukas Bulwahn
On Thu, Apr 11, 2024 at 05:21:05PM +0800, Hongbo Li wrote:
> Also, I am curious why such spelling errors cannot be detected at the
> compilation stage.
code coverage analysis would catch this. I'm one patch away from fully
automated code coverage.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG
2024-04-11 17:31 ` Kent Overstreet
@ 2024-04-12 1:35 ` Hongbo Li
0 siblings, 0 replies; 7+ messages in thread
From: Hongbo Li @ 2024-04-12 1:35 UTC (permalink / raw
To: Kent Overstreet
Cc: Lukas Bulwahn, Brian Foster, linux-bcachefs, kernel-janitors,
linux-kernel, Lukas Bulwahn
Thanks, got it. And I found many similar cases in other kernel modules.
Also, the janitors project seems quite interesting.
On 2024/4/12 1:31, Kent Overstreet wrote:
> On Thu, Apr 11, 2024 at 05:21:05PM +0800, Hongbo Li wrote:
>> Also, I am curious why such spelling errors cannot be detected at the
>> compilation stage.
>
> code coverage analysis would catch this. I'm one patch away from fully
> automated code coverage.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-12 1:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11 8:29 [PATCH] bcachefs: fix typo in reference to BCACHEFS_DEBUG Lukas Bulwahn
2024-04-11 9:16 ` Hongbo Li
2024-04-11 9:21 ` Hongbo Li
2024-04-11 10:21 ` Dan Carpenter
2024-04-11 11:44 ` Hongbo Li
2024-04-11 17:31 ` Kent Overstreet
2024-04-12 1:35 ` Hongbo Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).