aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2022-06-20 22:36:38 +0000
committerBrian Behlendorf <[email protected]>2022-06-27 14:18:57 -0700
commitb0f7dd276c930129fef8575e15a36ec659e31cd2 (patch)
tree70826ed25914805d5d75310b05c63ef296b27a56 /include
parenta6e8113fed8a508ffda13cf1c4d8da99a4e8133a (diff)
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 <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13528 Closes #13575
Diffstat (limited to 'include')
-rw-r--r--include/sys/zil.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sys/zil.h b/include/sys/zil.h
index 05e3647e6..2a7381f01 100644
--- a/include/sys/zil.h
+++ b/include/sys/zil.h
@@ -224,6 +224,15 @@ typedef struct {
} 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.
*
* Whenever new attributes are added the version number
@@ -233,7 +242,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;
/*