From: "Theodore Ts'o" <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h
Date: Mon, 4 May 2026 19:32:59 -0400 [thread overview]
Message-ID: <20260504233301.2345652-6-tytso@mit.edu> (raw)
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>
The LIST_HEAD macro is defined by both the Linux kernel's list.h and
<sys/queue.h> (originally from BSD). The problem is that on MacOS,
some system header file pulls in <sys/queue.h> leading to a macro
redefiniction conflict. Since we don't use LIST_HEAD in e2fsprogs,
the simplest mitigation is to just comment out the definition of LIST_HEAD.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 37dafcc0894b ("libsupport: port the kernel list.h to libsupport")
---
lib/support/list.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/support/list.h b/lib/support/list.h
index 0e00e446d..0ec8de525 100644
--- a/lib/support/list.h
+++ b/lib/support/list.h
@@ -36,8 +36,17 @@ static inline void list_head_destroy(struct list_head *list)
#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#if 0
+/*
+ * This conflicts with the LIST_HEAD defined in <sys/queue.h>. We
+ * don't include it in e2fsprogs, but some systems' header files might
+ * pull it in, leading to the macro redefinition conflict.
+ * Fortunately, we also don't need LIST_HEAD in e2fsprogs, so just
+ * drop this convenience macro.
+ */
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
+#endif
/**
* INIT_LIST_HEAD - Initialize a list_head structure
--
2.53.0
next prev parent reply other threads:[~2026-05-04 23:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 23:32 [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Theodore Ts'o
2026-05-04 23:32 ` [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary Theodore Ts'o
2026-05-05 0:11 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path Theodore Ts'o
2026-05-05 0:13 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 3/7] libsupport: don't use bzero in cache.c Theodore Ts'o
2026-05-05 0:15 ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI Theodore Ts'o
2026-05-05 0:20 ` Darrick J. Wong
2026-05-04 23:32 ` Theodore Ts'o [this message]
2026-05-05 0:20 ` [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h Darrick J. Wong
2026-05-04 23:33 ` [PATCH 6/7] libsupport: fix gcc -Wall warnings Theodore Ts'o
2026-05-05 0:20 ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 7/7] fuse2fs: fix uninitialized variable warnings Theodore Ts'o
2026-05-05 0:26 ` Darrick J. Wong
2026-05-05 0:08 ` [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Darrick J. Wong
2026-05-05 7:21 ` Theodore Tso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260504233301.2345652-6-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox