mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix -Wattribute-warning in zfs_log_xvattr()
Restructure the code in zfs_log_xvattr() to use a lr_attr_end structure when accessing lr_attr_t elements located after the variable sized array. This makes the code more understandable and resolves the accessing beyond the end of the field warnings. 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
This commit is contained in:
+10
-1
@@ -221,6 +221,15 @@ typedef struct {
|
||||
uint64_t lr_foid; /* object id */
|
||||
} lr_ooo_t;
|
||||
|
||||
/*
|
||||
* Additional lr_attr_t fields.
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t lr_attr_attrs; /* all of the attributes */
|
||||
uint64_t lr_attr_crtime[2]; /* create time */
|
||||
uint8_t lr_attr_scanstamp[32];
|
||||
} lr_attr_end_t;
|
||||
|
||||
/*
|
||||
* Handle option extended vattr attributes.
|
||||
*
|
||||
@@ -231,7 +240,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint32_t lr_attr_masksize; /* number of elements in array */
|
||||
uint32_t lr_attr_bitmap; /* First entry of array */
|
||||
/* remainder of array and any additional fields */
|
||||
/* remainder of array and additional lr_attr_end_t fields */
|
||||
} lr_attr_t;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user