[RFC PATCH v2 13/22] dlm: Use PAGE_SIZE_MIN in the lowcomms buffer size build check

From: Eric Curtin

Date: Tue Dec 01 2026 - 22:17:12 EST


From: Eric Curtin <eric.curtin@xxxxxxxxxx>

With arm64 boot-time page size selection PAGE_SIZE is not a compile-time
constant, so it cannot be used in BUILD_BUG_ON().

Check DLM_MAX_SOCKET_BUFSIZE against PAGE_SIZE_MIN in
dlm_lowcomms_new_msg() so that the message buffer fits in a page for
every supported page size.

No functional change for compile-time page sizes.

Signed-off-by: Eric Curtin <eric.curtin@xxxxxxxxxx>
---
fs/dlm/lowcomms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 3929b164dc0d..d991a47d8392 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1266,7 +1266,7 @@ struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, char **ppc,

if (len > DLM_MAX_SOCKET_BUFSIZE ||
len < sizeof(struct dlm_header)) {
- BUILD_BUG_ON(PAGE_SIZE < DLM_MAX_SOCKET_BUFSIZE);
+ BUILD_BUG_ON(PAGE_SIZE_MIN < DLM_MAX_SOCKET_BUFSIZE);
log_print("failed to allocate a buffer of size %d", len);
WARN_ON_ONCE(1);
return NULL;