kernel 6.3 compat: REQ_PREFLUSH without REQ_OP_WRITE returns error #14695
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist:
Signed-off-by
.