[PATCH 1/1] rpdfs: Fix memcpy() warnings about exceeding array boundaries

Chris Kirby <[email protected]> Tue, 24 Feb 2026 12:32:06 -0600
Newsgroups dev.linux.lists.rpdfs-devel
Message-ID <4929fe9179a7f89677bea9516e464488d60ae473.1771957670.git.ckirby@versity.com>
Fix kernel memcpy() warnings about exceeding array boundaries when
using flex arrays.

Remove the array size from the flex arrays in struct rpdfs_dirent
and struct rpdfs_xattr.

Signed-off-by: Chris Kirby <[email protected]>
---
 fs/rpdfs/format-block.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/rpdfs/format-block.h b/fs/rpdfs/format-block.h
index e594d58a55a9..332da5e14492 100644
--- a/fs/rpdfs/format-block.h
+++ b/fs/rpdfs/format-block.h
@@ -177,7 +177,7 @@ struct rpdfs_dirent {
 	struct rpdfs_ino_gen ig; /* inode number and generation */
 	__u8 pers_dtype; /* rpdfs persistent directory entry type */
 	__u8 name_len; /* no null termination */
-	__u8 name[6]; /* definition pads to alignment, stored can be smaller */
+	__u8 name[];
 };
 
 /* max dirent name length, without null term */
@@ -216,7 +216,7 @@ struct rpdfs_dirent {
 struct rpdfs_xattr {
 	__le16 val_len;
 	__u8 name_len;
-	__u8 name[1];
+	__u8 name[];
 };
 
 /*
-- 
2.53.0