[Devel] [PATCH RHEL10 COMMIT] fs/fuse kio: replace zero-length array with flexible array syntax
Konstantin Khorenko
khorenko at virtuozzo.com
Mon May 18 11:40:00 MSK 2026
The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.25.vz10
------>
commit 4da649462a5a49d5082685aecd55db4260c80f04
Author: Liu Kui <kui.liu at virtuozzo.com>
Date: Wed May 6 18:27:15 2026 +0800
fs/fuse kio: replace zero-length array with flexible array syntax
With FORTIFY_SOURCE, memcpy to a zero-length arrary field is flagged
as field-spanning, causing kernel warning. Switch to the C99 flexible
array [] syntax to fix this.
Changes:
- _data_buf[0] -> _data_buf[] in struct krpc_completion
- sync_resp[0] -> sync_resp[] in struct pcs_cs_iohdr
- nodes[0] -> nodes[] in struct pcs_cs_map_prop
- cs[0] -> cs[] in struct pcs_cs_list
- cs[0] -> cs[] in struct pcs_ioc_getmap
https://virtuozzo.atlassian.net/browse/VSTOR-130548
Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
Acked-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
Feature: vStorage
---
fs/fuse/kio/pcs/pcs_cs_prot.h | 4 ++--
fs/fuse/kio/pcs/pcs_ioctl.h | 2 +-
fs/fuse/kio/pcs/pcs_krpc.h | 2 +-
fs/fuse/kio/pcs/pcs_map.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/fuse/kio/pcs/pcs_cs_prot.h b/fs/fuse/kio/pcs/pcs_cs_prot.h
index c72066de7be4a..c524d28b551e1 100644
--- a/fs/fuse/kio/pcs/pcs_cs_prot.h
+++ b/fs/fuse/kio/pcs/pcs_cs_prot.h
@@ -79,7 +79,7 @@ struct pcs_cs_iohdr {
u32 fiemap_count; /* Used only in FIEMAP request, limit on number of extents to return */
};
struct pcs_cs_sync_data sync; /* Filled in all requests and responses */
- struct pcs_cs_sync_resp sync_resp[0]; /* Used only in response to write/sync */
+ struct pcs_cs_sync_resp sync_resp[]; /* Used only in response to write/sync */
} __attribute__((aligned(8)));
static inline int pcs_cs_use_aligned_io(u32 storage_version)
@@ -171,7 +171,7 @@ struct pcs_cs_map_prop {
u16 chain_nodes;
u16 reserved;
u32 nnodes;
- struct pcs_cs_node_desc nodes[0];
+ struct pcs_cs_node_desc nodes[];
} __attribute__((aligned(8)));
#define CS_OBJ_UNKNOWN -1
diff --git a/fs/fuse/kio/pcs/pcs_ioctl.h b/fs/fuse/kio/pcs/pcs_ioctl.h
index fb22cf8a01b0b..07a87d6507f3e 100644
--- a/fs/fuse/kio/pcs/pcs_ioctl.h
+++ b/fs/fuse/kio/pcs/pcs_ioctl.h
@@ -74,7 +74,7 @@ struct pcs_ioc_getmap
/* TODO: cs array is only for OUT ? */
u32 cs_cnt; /* The number of CS (including root) entries that follows */
u32 cs_max; /* Max number of CS (including root) entries requested */
- struct pcs_cs_info cs[0]; /* Array of CS including root */
+ struct pcs_cs_info cs[]; /* Array of CS including root */
};
#define PCS_IOC_NOCSUMONREAD _IOW('V',3,u32)
diff --git a/fs/fuse/kio/pcs/pcs_krpc.h b/fs/fuse/kio/pcs/pcs_krpc.h
index 427c598f01f7e..766121d3a4771 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.h
+++ b/fs/fuse/kio/pcs/pcs_krpc.h
@@ -101,7 +101,7 @@ struct krpc_completion {
void *private;
int data_len;
- u8 _data_buf[0];
+ u8 _data_buf[];
};
#define KRPC_MAX_DATA_PAGES 256
diff --git a/fs/fuse/kio/pcs/pcs_map.h b/fs/fuse/kio/pcs/pcs_map.h
index bf8a0e7177d02..788a8cb16d8e9 100644
--- a/fs/fuse/kio/pcs/pcs_map.h
+++ b/fs/fuse/kio/pcs/pcs_map.h
@@ -127,7 +127,7 @@ struct pcs_cs_list
int write_timeout;
int nsrv;
PCS_MAP_VERSION_T version; /* version inherented from map */
- struct pcs_cs_record cs[0];
+ struct pcs_cs_record cs[];
};
/* TODO, LOCKING!!!!!
More information about the Devel
mailing list