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

Use fallthrough macro (2.1 edition) #12671

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

rincebrain
Copy link
Contributor

Motivation and Context

Debug building is broken on e.g. Fedora 35 without it. (Waves to #12667)

Description

Just kicking 6954c22 until it applied to 2.1. Nothing fancy, though I was impressed with how badly git cherry-pick got confused by some of them initially.

How Has This Been Tested?

Well, without this, 2.1-release won't build with --enable-debug on F35, and with this, it will.

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@tonyhutter
Copy link
Contributor

@rincebrain would you mind making a trivial update to get around the conflict? I think this is all you need for zfs_context_os.h:

diff --git a/include/os/linux/zfs/sys/zfs_context_os.h b/include/os/linux/zfs/sys/zfs_context_os.h
index 981a6b8..9e42605 100644
--- a/include/os/linux/zfs/sys/zfs_context_os.h
+++ b/include/os/linux/zfs/sys/zfs_context_os.h
@@ -25,6 +25,7 @@
 
 #include <linux/dcache_compat.h>
 #include <linux/utsname_compat.h>
+#include <linux/compiler_compat.h>
 #include <linux/module.h>
 
 #if THREAD_SIZE >= 16384

As of the Linux 5.9 kernel a fallthrough macro has been added which
should be used to anotate all intentional fallthrough paths.  Once
all of the kernel code paths have been updated to use fallthrough
the -Wimplicit-fallthrough option will because the default.  To
avoid warnings in the OpenZFS code base when this happens apply
the fallthrough macro.

Additional reading: https://lwn.net/Articles/794944/

Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#12441
@rincebrain
Copy link
Contributor Author

rincebrain commented Nov 1, 2021

Hopefully I didn't accidentally rewrite history in a way that merging the branch will break the world, but there.

edit: I needn't have bothered looking at the CI results; without #12700 and #12673, this wouldn't have passed anyway.

@tonyhutter tonyhutter merged commit 143476c into openzfs:zfs-2.1.2-staging Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants