Skip to content

kernel 6.3 compat: REQ_PREFLUSH without REQ_OP_WRITE returns error #14695

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

youzhongyang
Copy link
Contributor

Signed-off-by: Youzhong Yang [email protected]

Motivation and Context

Someone reported the issue when testing #14682. More info available in the comments section of #14682.

The commit "block: add a sanity check for non-write flush/fua bios" in kernel 6.3 introduced a check to make sure that the PREFLUSH and FUA flags are only set on write bios. If it's not the case, an I/O error will be returned when doing flush.

Description

Modify bio_set_flush() so if kernel version is >= 4.10, flags REQ_PREFLUSH and REQ_OP_WRITE are set together.

I've checked a bunch of kernel versions, all of them have these two flags defined.

How Has This Been Tested?

Build and test in an old 5.15 kernel and new 6.3-rc4 kernel.

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:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 30, 2023
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 30, 2023
@behlendorf behlendorf merged commit c5431f1 into openzfs:master Mar 31, 2023
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Mar 31, 2023
Modify bio_set_flush() so if kernel version is >= 4.10, flags 
REQ_PREFLUSH and REQ_OP_WRITE are set together.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Youzhong Yang <[email protected]>
Closes openzfs#14695
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Apr 6, 2023
Modify bio_set_flush() so if kernel version is >= 4.10, flags 
REQ_PREFLUSH and REQ_OP_WRITE are set together.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Youzhong Yang <[email protected]>
Closes openzfs#14695
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Apr 13, 2023
Modify bio_set_flush() so if kernel version is >= 4.10, flags 
REQ_PREFLUSH and REQ_OP_WRITE are set together.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Youzhong Yang <[email protected]>
Closes openzfs#14695
pcd1193182 pushed a commit to pcd1193182/zfs that referenced this pull request Sep 26, 2023
Modify bio_set_flush() so if kernel version is >= 4.10, flags 
REQ_PREFLUSH and REQ_OP_WRITE are set together.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Youzhong Yang <[email protected]>
Closes openzfs#14695
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