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

module: weld all but spl.ko into zfs.ko #13274

Closed
wants to merge 6 commits into from

Conversation

nabijaczleweli
Copy link
Contributor

@nabijaczleweli nabijaczleweli commented Mar 31, 2022

Motivation and Context

I guess this supersedes #13206?

We can't weld spl.ko in because it launders hand-washes GPL-only symbols: #13206 (comment)

How Has This Been Tested?

git grep 🙈; builds in- and out-of-tree, zstd symbols get regenerated idempotently, I tried the explicit targets in the Makefile and they all work fine.

Haven't tried DKMS builds, built-in (but CI will), FreeBSD, or any of the Fedora-specific stuff (but I did fix them so long as they mentioned the module names).

zfs is aliased to all the previous module names so this is transparent (except for /sys/module/XXX/ paths, but there was exactly one in use).

I just inlined the init/fini externs for zcommon in both callsites. I don't think it matters much, it's also what we do for some parameters on FreeBSD.

Cc: @rincebrain

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:

  • My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes. – fixed them, the rest should be fine probably
  • I have run the ZFS Test Suite with this change applied. – CI take my hand, also see sexion 2
  • All commit messages are properly formatted and contain Signed-off-by.

@nabijaczleweli nabijaczleweli force-pushed the unicode branch 3 times, most recently from 9bbc308 to ee07114 Compare April 1, 2022 18:56
@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Apr 1, 2022

I also did a pass over licences and authors and now the modinfo looks like this:

root@kasan-test:~/zfs# modinfo module/zfs.ko  | head -30
filename:       /root/zfs/module/zfs.ko
version:        2.1.99-991_g5e98d1db2
license:        CDDL
license:        Dual BSD/GPL
license:        zstd: Dual BSD/GPL
license:        Lua: MIT
author:         OpenZFS
author:         zstd: Facebook, Inc.
author:         Lua: Lua.org, PUC-Rio
description:    ZFS
alias:          zzstd
alias:          zcommon
alias:          zunicode
alias:          znvpair
alias:          zlua
alias:          icp
alias:          zavl
alias:          devname:zfs
alias:          char-major-10-249
srcversion:     5C193FC283BE6EE531D4959
depends:        spl
retpoline:      Y
name:           zfs
vermagic:       5.16.0-5-amd64 SMP preempt mod_unload modversions

(Fletcher implementations are BSD/GPL.)

Only the first stanza matters, so this still taints the kernel.

@rincebrain
Copy link
Contributor

I would suggest that #13206 might want to still land before this does, if only because #13206 is much less disruptive to, say, backport into 2.1. (Not saying that you can't do that for this, just that the act of flattening the modules might be a bit much to do in a point release, IMO.)

I figured I'd do a more thorough read once the CI has less ❌, but my only immediate thought was "we probably want zfs.sh to still try to unload the old module names for at least a few versions, otherwise zfs.sh -u won't DTRT if you cross this boundary". (I also thought the same about make uninstall.)

@nabijaczleweli nabijaczleweli force-pushed the unicode branch 3 times, most recently from 62109f8 to e1c1c1a Compare April 4, 2022 11:39
@nabijaczleweli
Copy link
Contributor Author

Neither of these are backportable because both of them break a committed userspace ABI (except this does {icp => zfs}.icp_{{aes,gcm}_impl,gcm_avx_chunk_size} and {zcommon => zfs}.zfs_{fletcher_4_impl,max_dataset_missing} and #13206 does {zfs => zcommon}.zfs_dbgmsg_{enable,maxsize}, which would (a) get reverted when this lands and (b) this accomplishes the same goal).

The upgrade path is a good point. I fixed zfs.sh to just unload with dependencies via modprobe -r, which works everywhere, on both sides of the upgrade. And the (un)installation by removing the former directories, in a separate, trivially reversible (once we hit 3.0, or whenever we'll be able to safely) commit.

@rincebrain
Copy link
Contributor

I don't know that we promise anything about the tunables not changing in point releases, but it's simple enough to also still expose them from zfs in addition to zcommon, like #13206 currently does with zfs_flags.

@nabijaczleweli
Copy link
Contributor Author

Does it? Looks to me like it got moved wholesale, including the tunable procfs path.

@rincebrain
Copy link
Contributor

rincebrain commented Apr 4, 2022

I believe I moved it and copied the tunable code, but didn't delete the old one.

@nabijaczleweli
Copy link
Contributor Author

Well, yeah, but the other two zfs_dbgmsg_{enable,maxsize} tunables did get moved, so that's, I'd say, worse?

@rincebrain
Copy link
Contributor

Sure, my remark was that that's trivial to add back again, if that's the primary concern.

@nabijaczleweli
Copy link
Contributor Author

I mean, if you foresee new code using zfs_dbgmsg outside zfs.ko proper in 2.x backports, then so long as you move those tunables back to zfs.ko as well, then this is transparent to the user, and I've no objections

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 4, 2022
module/Makefile.in Show resolved Hide resolved
module/os/linux/zfs/zfs_ioctl_os.c Outdated Show resolved Hide resolved
module/Kbuild.in Show resolved Hide resolved
module/Kbuild.in Outdated Show resolved Hide resolved
@behlendorf behlendorf requested a review from tonyhutter April 7, 2022 00:23
@rincebrain
Copy link
Contributor

rincebrain commented Apr 7, 2022 via email

@nabijaczleweli
Copy link
Contributor Author

CI's all green (save for built-in, but that's because of default_attrs) – is there anything else needed for this?

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.

This looks good to me, just one trivial cosmetic nit.

scripts/zfs.sh Show resolved Hide resolved
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 15, 2022
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Originally it was thought it would be useful to split up the kmods
by functionality.  This would allow external consumers to only load
what was needed.  However, in practice we've never had a case where
this functionality would be needed, and conversely managing multiple
kmods can be awkward.  Therefore, this change merges all but the
spl.ko kmod in to a single zfs.ko kmod.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Originally it was thought it would be useful to split up the kmods
by functionality.  This would allow external consumers to only load
what was needed.  However, in practice we've never had a case where
this functionality would be needed, and conversely managing multiple
kmods can be awkward.  Therefore, this change merges all but the
spl.ko kmod in to a single zfs.ko kmod.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Originally it was thought it would be useful to split up the kmods
by functionality.  This would allow external consumers to only load
what was needed.  However, in practice we've never had a case where
this functionality would be needed, and conversely managing multiple
kmods can be awkward.  Therefore, this change merges all but the
spl.ko kmod in to a single zfs.ko kmod.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Originally it was thought it would be useful to split up the kmods
by functionality.  This would allow external consumers to only load
what was needed.  However, in practice we've never had a case where
this functionality would be needed, and conversely managing multiple
kmods can be awkward.  Therefore, this change merges all but the
spl.ko kmod in to a single zfs.ko kmod.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Originally it was thought it would be useful to split up the kmods
by functionality.  This would allow external consumers to only load
what was needed.  However, in practice we've never had a case where
this functionality would be needed, and conversely managing multiple
kmods can be awkward.  Therefore, this change merges all but the
spl.ko kmod in to a single zfs.ko kmod.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
We don't pass the arguments as arguments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
This can be reverted once we're sure nobody's using them anymore
(post-3.0 release?)

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants