Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4.14 CONFIG_GCC_PLUGIN_RANDSTRUCT build #6903

Merged
merged 1 commit into from Nov 28, 2017

Conversation

markwright
Copy link
Contributor

@markwright markwright commented Nov 28, 2017

Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
nvs_native_nvlist,
^~~~~~~~~~~~~~~~~

Signed-off-by: Mark Wright gienah@gentoo.org

Description

Specify the struct member that is being initialized.

Motivation and Context

Fixes build errors with gcc 7.2.0 on Gentoo with kernel 4.14.2 built with
CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/nvpair/nvpair.c:2810:2:error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/nvpair/nvpair.c:2810:2: note: (near initialization for ‘nvs_native_ops’)
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/nvpair/nvpair.c:2810:2:error: invalid initializer
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/nvpair/nvpair.c:2810:2: note: (near initialization for ‘nvs_native_ops.<anonymous>’)
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/nvpair/nvpair.c:2811:2:error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
  nvs_native_nvpair,
  ^~~~~~~~~~~~~~~~~

How Has This Been Tested?

I built sys-fs/zfs-kmod-9999 patched with these changes, then booted
my Gentoo machine running on zfs with the changes using
sys-kernel/gentoo-sources-4.14.2 built with
CONFIG_GCC_PLUGIN_RANDSTRUCT=y

argus ~ # uname -a
Linux argus 4.14.2-gentoo #1 SMP Mon Nov 27 10:17:35 AEDT 2017 x86_64 Intel(R) Core(TM) i7 CPU X 940 @ 2.13GHz GenuineIntel GNU/Linux
argus ~ # grep CONFIG_GCC_PLUGIN_RANDSTRUCT /usr/src/linux-4.14.2-gentoo/.config
CONFIG_GCC_PLUGIN_RANDSTRUCT=y
CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=y
argus ~ # 

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Signed-off-by: Mark Wright <gienah@gentoo.org>
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@codecov
Copy link

codecov bot commented Nov 28, 2017

Codecov Report

Merging #6903 into master will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6903      +/-   ##
==========================================
+ Coverage    75.1%   75.27%   +0.16%     
==========================================
  Files         298      298              
  Lines       95270    95270              
==========================================
+ Hits        71555    71714     +159     
+ Misses      23715    23556     -159
Flag Coverage Δ
#kernel 74.31% <ø> (-0.21%) ⬇️
#user 67.63% <ø> (+0.39%) ⬆️
Impacted Files Coverage Δ
module/zfs/fm.c 36.59% <ø> (ø) ⬆️
module/icp/io/skein_mod.c 4.89% <ø> (ø) ⬆️
module/icp/io/sha2_mod.c 28.72% <ø> (ø) ⬆️
module/icp/io/sha1_mod.c 2.4% <ø> (ø) ⬆️
module/zfs/vdev_raidz.c 96.21% <ø> (+0.34%) ⬆️
module/nvpair/nvpair.c 75.95% <ø> (ø) ⬆️
module/nvpair/nvpair_alloc_fixed.c 0% <ø> (ø) ⬆️
module/icp/io/aes.c 28.95% <ø> (ø) ⬆️
module/zfs/zfs_acl.c 54.42% <ø> (-0.1%) ⬇️
module/icp/os/modconf.c 32% <ø> (ø) ⬆️
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94183a9...a83883e. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 28, 2017

Codecov Report

Merging #6903 into master will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6903      +/-   ##
==========================================
+ Coverage    75.1%   75.27%   +0.16%     
==========================================
  Files         298      298              
  Lines       95270    95270              
==========================================
+ Hits        71555    71714     +159     
+ Misses      23715    23556     -159
Flag Coverage Δ
#kernel 74.31% <ø> (-0.21%) ⬇️
#user 67.63% <ø> (+0.39%) ⬆️
Impacted Files Coverage Δ
module/zfs/vdev_mirror.c 99.13% <ø> (+0.86%) ⬆️
module/zfs/vdev_raidz.c 96.21% <ø> (+0.34%) ⬆️
module/nvpair/nvpair_alloc_fixed.c 0% <ø> (ø) ⬆️
module/nvpair/nvpair_alloc_spl.c 50% <ø> (ø) ⬆️
module/zfs/fm.c 36.59% <ø> (ø) ⬆️
module/nvpair/nvpair.c 75.95% <ø> (ø) ⬆️
module/icp/io/aes.c 28.95% <ø> (ø) ⬆️
module/icp/io/sha2_mod.c 28.72% <ø> (ø) ⬆️
module/icp/os/modconf.c 32% <ø> (ø) ⬆️
module/icp/io/skein_mod.c 4.89% <ø> (ø) ⬆️
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94183a9...a83883e. Read the comment docs.

@behlendorf behlendorf merged commit 56d8d8a into openzfs:master Nov 28, 2017
@behlendorf behlendorf added this to PR Needed for 0.7.4 in 0.7.4 Nov 28, 2017
behlendorf pushed a commit to tonyhutter/zfs that referenced this pull request Nov 28, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes openzfs#5390
Closes openzfs#6903

Requires-spl: refs/pull/669/head
behlendorf pushed a commit to tonyhutter/zfs that referenced this pull request Dec 1, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes openzfs#5390
Closes openzfs#6903

Requires-spl: refs/pull/669/head
tonyhutter pushed a commit that referenced this pull request Dec 5, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes #5390
Closes #6903
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 5, 2017
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes openzfs#5390
Closes openzfs#6903
@behlendorf behlendorf moved this from PR Needed for 0.7.4 to Merged to 0.7.4 in 0.7.4 Dec 12, 2017
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this pull request Jan 29, 2018
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes openzfs#5390
Closes openzfs#6903
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this pull request Feb 13, 2018
Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes openzfs#5390
Closes openzfs#6903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.7.4
Merged to 0.7.4
Development

Successfully merging this pull request may close these issues.

None yet

2 participants