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

Fixes 5.12 bio bi_bdev additions and GPL issues with bio_*_io_acct functions #11639

Closed
wants to merge 2 commits into from

Conversation

ckane
Copy link
Contributor

@ckane ckane commented Feb 23, 2021

Motivation and Context

Recent changes in the Linux kernel 5.12 merges modified the interfaces in the following breaking manners:

  • Functions bio_start_io_acct and bio_end_io_acct became GPL'd exports
  • The bio->bi_disk member was moved into a new struct block_device* member of struct bio such that accessing it now must be done as bio->bi_bdev->bd_disk

Description

Replaced calls to bio_*_io_acct with corresponding calls to disk_*_io_acct, the latter are not GPL-encumbered

How Has This Been Tested?

I have been using this in production on my personal system with ZFS root and so far it has been working fine

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:

The struct bio member bi_disk was moved underneat a new member named
bi_bdev. So all attempts to reference bio->bi_disk need to now become
bio->bi_bdev->bd_disk.

Signed-off-by: Coleman Kane <[email protected]>
The bio_*_acct functions became GPL exports, which is causing the
kernel modules to refuse to compile. This replaces code with
alternate function calls to the disk_*_io_acct interfaces, which
are not GPL exports. This change was added in kernel commit
99dfc43ecbf67f12a06512918aaba61d55863efc.

Signed-off-by: Coleman Kane <[email protected]>
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Feb 23, 2021
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 24, 2021
behlendorf pushed a commit that referenced this pull request Feb 24, 2021
The bio_*_acct functions became GPL exports, which causes the
kernel modules to refuse to compile. This replaces code with
alternate function calls to the disk_*_io_acct interfaces, which
are not GPL exports. This change was added in kernel commit
99dfc43ecbf67f12a06512918aaba61d55863efc.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #11639
behlendorf pushed a commit that referenced this pull request Mar 5, 2021
The struct bio member bi_disk was moved underneath a new member named
bi_bdev. So all attempts to reference bio->bi_disk need to now become
bio->bi_bdev->bd_disk.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #11639
behlendorf pushed a commit that referenced this pull request Mar 5, 2021
The bio_*_acct functions became GPL exports, which causes the
kernel modules to refuse to compile. This replaces code with
alternate function calls to the disk_*_io_acct interfaces, which
are not GPL exports. This change was added in kernel commit
99dfc43ecbf67f12a06512918aaba61d55863efc.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #11639
@ckane ckane deleted the fixes-5.12 branch March 7, 2021 22:51
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
The struct bio member bi_disk was moved underneath a new member named
bi_bdev. So all attempts to reference bio->bi_disk need to now become
bio->bi_bdev->bd_disk.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#11639
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
The bio_*_acct functions became GPL exports, which causes the
kernel modules to refuse to compile. This replaces code with
alternate function calls to the disk_*_io_acct interfaces, which
are not GPL exports. This change was added in kernel commit
99dfc43ecbf67f12a06512918aaba61d55863efc.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#11639
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
The struct bio member bi_disk was moved underneath a new member named
bi_bdev. So all attempts to reference bio->bi_disk need to now become
bio->bi_bdev->bd_disk.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#11639
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
The bio_*_acct functions became GPL exports, which causes the
kernel modules to refuse to compile. This replaces code with
alternate function calls to the disk_*_io_acct interfaces, which
are not GPL exports. This change was added in kernel commit
99dfc43ecbf67f12a06512918aaba61d55863efc.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#11639
@RaitoBezarius
Copy link
Contributor

I am seeing this problem with Linux 6.2.8 and zfs-staging a5c469c again.

@RaitoBezarius
Copy link
Contributor

Specifically:

  > ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'bio_start_io_acct'
  > ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'bio_end_io_acct_remapped'

@ckane
Copy link
Contributor Author

ckane commented Mar 24, 2023

Specifically:

  > ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'bio_start_io_acct'
  > ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'bio_end_io_acct_remapped'

Can you open up a new issue to track the regression from the newer kernel? GitHub is going to keep this issue buried from view since it is already closed.

@RaitoBezarius
Copy link
Contributor

It's already open: #14658 — it was just easier to find this one, I apologize for the noise.

@ckane
Copy link
Contributor Author

ckane commented Mar 24, 2023

No worries, after I responded I went back and looked around a bit and found that one too - noise is no problem, just wanted to make sure it didn't get lost.

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.

3 participants