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

[2.2] Linux 6.7 compat #15694

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Conversation

robn
Copy link
Member

@robn robn commented Dec 21, 2023

Motivation and Context

Backport #15681 to 2.2.

Upcoming Linux 6.7 release will change a couple of interfaces. Adapt or die!

Description

Adjusts for three changes:

  • i_atime and i_mtime in struct inode are no longer directly accessible, but must use accessor functions
  • s_shrink in struct super_block is now a pointer rather than an embedded struct
  • The "shrinker" (ie inode reclaim) API has changed, such that the kernel now allocates shrinkers dynamically rather than allowing a static shrinker to be registered.

How Has This Been Tested?

This version compiled checked against 6.7-rc6 and 5.10.170. Assuming its fine elsewhere based on testing in #15681.

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:

6.7 changed the names of the time members in struct inode, so we can't
assign back to it because we don't know its name. In practice this
doesn't matter though - if we're missing current_time(), then we must be
on <4.9, and we know our fallback will need to return timespec.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://github.com/sponsors/robn
6.6 made i_ctime inaccessible; 6.7 has done the same for i_atime and
i_mtime. This extends the method used for ctime in b37f293 to atime
and mtime as well.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://github.com/sponsors/robn
In 6.7 the superblock shrinker member s_shrink has changed from being an
embedded struct to a pointer. Detect this, and don't take a reference if
it already is one.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://github.com/sponsors/robn
6.7 changes the shrinker API such that shrinkers must be allocated
dynamically by the kernel. To accomodate this, this commit reworks
spl_register_shrinker() to do something similar against earlier kernels.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://github.com/sponsors/robn
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Dec 21, 2023
@behlendorf behlendorf merged commit 03b8409 into openzfs:zfs-2.2.3-staging Dec 21, 2023
23 of 24 checks passed
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.

None yet

2 participants