]> git.ipfire.org Git - thirdparty/linux.git/commit
reiserfs: Replace one-element array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 21 Jun 2023 22:43:54 +0000 (16:43 -0600)
committerGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 12 Jul 2023 19:09:46 +0000 (13:09 -0600)
commit76d2ceda723c90ad7ee93224b8ebaeeb4ea13203
tree04fb69aa3f6675a769bcb8098426502fb93fde6f
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
reiserfs: Replace one-element array with flexible-array member

One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in direntry_uarea structure, and refactor the rest of the code,
accordingly.

Worth mentioning is that before these changes, the original implementation
was returning two-too many bytes in function direntry_create_vi():

fs/reiserfs/item_ops.c:464:     int size = sizeof(struct direntry_uarea);
...
fs/reiserfs/item_ops.c-490-     size += (dir_u->entry_count * sizeof(short));
...
fs/reiserfs/item_ops.c-517-     return size;

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/290
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
fs/reiserfs/fix_node.c
fs/reiserfs/reiserfs.h