Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* btrfs ASSERT() error when make C=1, but OK when make C=0
@ 2025-12-22 14:37 Wang Yugui
  2025-12-22 19:57 ` Qu Wenruo
  2025-12-25  1:33 ` Wang Yugui
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Yugui @ 2025-12-22 14:37 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I noticed a lot of make C=1 error of btrfs ASSERT(),
but make C=0 is OK.

block-group.c: note: in included file:
zoned.h:417:9: error: Expected ) in function call
zoned.h:417:9: error: got __VA_OPT__

static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
{
L417:    ASSERT(btrfs_is_zoned(bg->fs_info));
    return (bg->alloc_offset == bg->zone_capacity);
}

Any help to fix it?

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2025/12/22



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs ASSERT() error when make C=1, but OK when make C=0
  2025-12-22 14:37 btrfs ASSERT() error when make C=1, but OK when make C=0 Wang Yugui
@ 2025-12-22 19:57 ` Qu Wenruo
  2025-12-25  1:33 ` Wang Yugui
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2025-12-22 19:57 UTC (permalink / raw)
  To: Wang Yugui, linux-btrfs



在 2025/12/23 01:07, Wang Yugui 写道:
> Hi,
> 
> I noticed a lot of make C=1 error of btrfs ASSERT(),
> but make C=0 is OK.
> 
> block-group.c: note: in included file:
> zoned.h:417:9: error: Expected ) in function call
> zoned.h:417:9: error: got __VA_OPT__

You know this is from sparse right?

And sparse is known to cause false positive.

> 
> static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
> {
> L417:    ASSERT(btrfs_is_zoned(bg->fs_info));
>      return (bg->alloc_offset == bg->zone_capacity);
> }
> 
> Any help to fix it?

Then why don't you dig it deeper?
You are an employed developer, not some newbie.

Do your work, not off load it to others.

> 
> Best Regards
> Wang Yugui (wangyugui@e16-tech.com)
> 2025/12/22
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs ASSERT() error when make C=1, but OK when make C=0
  2025-12-22 14:37 btrfs ASSERT() error when make C=1, but OK when make C=0 Wang Yugui
  2025-12-22 19:57 ` Qu Wenruo
@ 2025-12-25  1:33 ` Wang Yugui
  1 sibling, 0 replies; 3+ messages in thread
From: Wang Yugui @ 2025-12-25  1:33 UTC (permalink / raw)
  To: linux-btrfs

Hi

> Hi,
> 
> I noticed a lot of make C=1 error of btrfs ASSERT(),
> but make C=0 is OK.
> 
> block-group.c: note: in included file:
> zoned.h:417:9: error: Expected ) in function call
> zoned.h:417:9: error: got __VA_OPT__
> 
> static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
> {
> L417:    ASSERT(btrfs_is_zoned(bg->fs_info));
>     return (bg->alloc_offset == bg->zone_capacity);
> }
> 
> Any help to fix it?

We can walk around this problem with the flowing patch.
It seems that sparse(make C=1) does yet not support __VA_OPT__.

diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h
index dea30823d61a..8755a5bc7ece 100644
--- a/fs/btrfs/messages.h
+++ b/fs/btrfs/messages.h
@@ -111,7 +111,7 @@ static inline void verify_assert_printk_format(const char *fmt, ...) {
  * As ##__VA_ARGS__ cannot be at the beginning of the macro the __VA_OPT__ is needed
  * and supported since GCC 8 and Clang 12.
  */
-#define __REST_ARGS(_, ... ) __VA_OPT__(,) __VA_ARGS__
+#define __REST_ARGS(_, ... ) , ##__VA_ARGS__
 
 #if defined(CONFIG_CC_IS_CLANG) || GCC_VERSION >= 80000
 /*


Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2025/12/25


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-25  1:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 14:37 btrfs ASSERT() error when make C=1, but OK when make C=0 Wang Yugui
2025-12-22 19:57 ` Qu Wenruo
2025-12-25  1:33 ` Wang Yugui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox