]> git.proxmox.com Git - mirror_zfs.git/commit
Fix -Wattribute-warning in dsl layer
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 20 Jun 2022 21:13:26 +0000 (21:13 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 27 Jul 2022 20:38:56 +0000 (13:38 -0700)
commit087f5dedd5f193907d74fd15bf437b21fc0f4f17
tree65560787d7624234894a268f19da445df42c9015
parentc771583f238f74588cfed1c7ecb07cf704905958
Fix -Wattribute-warning in dsl layer

The memcpy(), memmove(), and memset() functions have been annotated
to perform bounds checking when using FORTIFY_SOURCE.  A warning is
now generted when writing beyond the end of the specified field.

Alternately, the new struct_group() macro could be used to create
an anonymous union member for use by memcpy().  However, since this
is the only place the macro would be helpful it's preferable to
restructure the code slights to avoid the need for additional
compatibility code when the macro does not exist.

https://lore.kernel.org/lkml/20211118183807.1283332-1-keescook@chromium.org/T/

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575
module/zfs/dsl_bookmark.c