From 3d90402f9084edb90ddb00d6ccd8c2183e6df140 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Sat, 28 Dec 2024 14:41:15 +0100 Subject: [PATCH] fuse_lowlevel.c: define FUSE_MAXOP as CUSE_INIT We don't want FUSE_MAXOP calculated at compilation time, as the ABI limit is CUSE_INIT - better use that value directly. Signed-off-by: Bernd Schubert --- lib/fuse_lowlevel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index e48efa5..a0d8647 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2712,7 +2712,12 @@ static struct { [CUSE_INIT] = { cuse_lowlevel_init, "CUSE_INIT" }, }; -#define FUSE_MAXOP (sizeof(fuse_ll_ops) / sizeof(fuse_ll_ops[0])) +/* + * For ABI compatibility we cannot allow higher values than CUSE_INIT. + * Without ABI compatibility we could use the size of the array. + * #define FUSE_MAXOP (sizeof(fuse_ll_ops) / sizeof(fuse_ll_ops[0])) + */ +#define FUSE_MAXOP (CUSE_INIT + 1) static const char *opname(enum fuse_opcode opcode) { -- 2.30.2