-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Accumulated fixes for 5.10 kernel-introduced build breakages #11085
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11085 +/- ##
==========================================
- Coverage 79.81% 79.56% -0.25%
==========================================
Files 398 398
Lines 125754 125754
==========================================
- Hits 100367 100055 -312
- Misses 25387 25699 +312
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Kernel commit 2b0d3d3e4fcfb on Oct 1 brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Signed-off-by: Coleman Kane <ckane@colemankane.org>
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Signed-off-by: Coleman Kane <ckane@colemankane.org>
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, I think that swapping the old function call out for the new one should be all that is required. Signed-off-by: Coleman Kane <ckane@colemankane.org>
This commit contains a number of style fixes to correct some style bugs introduced into include/os/linux/kernel/linux/blkdev_compat.h during the recent set of commits updating this module to 5.10 kernel API changes. Signed-off-by: Coleman Kane <ckane@colemankane.org>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
The original version I wrote performed some dereference logic which worked in my own builds, but appears to not work in the autotools setup used in the style checker. This commit simplifies the test and hopefully will appease more variations of autotools. Signed-off-by: Coleman Kane <ckane@colemankane.org>
bd9a50d
to
88575e6
Compare
Rebased this with |
A #define for zfs_check_media_change contained a space between the macro name and the expansion, rather than a tab. The other #define's around it use tabs to separate the fields. This fixes that small style defect. Signed-off-by: Coleman Kane <ckane@colemankane.org>
Apologies for the delay in getting anything back on this. I have tested this in a VM on kernel 5.9.1, but one of the issues with the zfs-test suite is that it looks like there are a bunch of tests that fail unexpectedly already on the current HEAD of both 2.0-release and master.... so I'm doing a zfs-test against 2.0-release branch with & w/out these changes applied, so that I can identify if they introduce any new testing regressions after they've been applied. Looks like in the buildbot stuff above all of the tests are completing successfully, minus the FreeBSD one, which I doubt was introduced by my changes. |
Running
|
As no new functionality is added and no behavioral changes are expected, I checked the "added tests" box, but there were no new tests to add. Similarly, the documentation in the source code I added should be sufficient documentation for these changes. |
Ok I'm running these changes on main now (patched against the 2.0.0rc4 sources) |
@behlendorf and @ahrens I think this one requires a review and removal of the WIP tag. @ckane You might at least squash the style fixes (or even better: cherrypick and squash them into their respective commits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckane thanks for putting together these fixes. They look good and work correctly for me with the latest mainline kernel. I'll squash them accordingly when merging.
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
Merged and squashed. |
This would be nice to have backported to the |
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes #11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Backported-by: Aron Xu <aron@debian.org> Signed-off-by: Aron Xu <aron@debian.org> Closes openzfs#11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Backported-by: Aron Xu <aron@debian.org> Signed-off-by: Aron Xu <aron@debian.org> Closes openzfs#11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
In Linux 5.10 the linux/frame.h header was renamed linux/objtool.h. Add a configure check to detect and use the correctly named header. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11085
Kernel commit 2b0d3d3e4fcfb brought in some changes to the struct percpu_ref structure that moves most of its fields into a member struct named "data" of type struct percpu_ref_data. This includes the "count" member which is updated by vdev_blkg_tryget(), so update this function to chase the API change, and detect it via configure. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
Kernel 5.10 removed check_disk_change() in favor of callers using the faster bdev_check_media_change() instead, and explicitly forcing bdev revalidation when they desire that behavior. To preserve prior behavior, I have wrapped this into a zfs_check_media_change() macro that calls an inline function for the new API that mimics the old behavior when check_disk_change() doesn't exist, and just calls check_disk_change() if it exists. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
A new function was added named revalidate_disk_size() and the old revalidate_disk() appears to have been deprecated. As the only ZFS code that calls this function is zvol_update_volsize, swapping the old function call out for the new one should be all that is required. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Coleman Kane <ckane@colemankane.org> Closes openzfs#11085
Motivation and Context
The latest pulls ahead of the Linux 5.10 release cycle introduced some API changes that break the build. In particular
check_disk_change()
andrevalidate_disk()
have been removed, and the "count" variable for thepercpu_ref
data structure has now been moved into a child data structure of typepercpu_ref_data
.Description
revalidate_disk()
withrevalidate_disk_size()
where the former is unavailable, as the context in which it is called within the driver suggests that the latter is the appropriate function to call.check_disk_change()
was a combination of checking for the change and also forcing revalidation of the device. The new preferred function isbdev_check_media_change()
which does the check, but doesn't force a revalidation, which is now left up to the caller if it wants to. To preserve the old behavior, I have created a wrapper function whencheck_disk_change()
doesn't exist that will callbdev_check_media_change()
and then also perform the revalidate call before returning. It may be worth revisiting whether this behavior is needed in all cases where the code is used.vdev_blkg_tryget()
function implements a local version of function calls that are implemented in GPL'd Linux code. The API changes break our version, and the solution to address this was just to switchref->count
to usingref->data->count
instead. The underlying change helps reduce memory usage where local copies ofstruct percpu_ref
are created, so that the underlying metadata only links to a single instance, which also now remains consistent across all copies of thestruct percpu_ref
instance.How Has This Been Tested?
So far I have compiled on 5.10 (Linus' tree), 5.9.0, and 5.8.14 and the build worked fine. I have not yet run-time tested this version of the module, which will take some more time to do. I wanted to get the PR up here so that all the build/test automation you've got can take a crack at it in parallel with me testing it.
Types of changes
Checklist:
Signed-off-by
.