Linux 5.10 compat: restore custom uio_prefaultpages() #11484
Merged
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.
Motivation and Context
Issue #11463. Regression observed on CentOS 7.9 due to Linux 5.10
compatibility changes.
Description
As part of commit 1c2358c the custom
uio_prefaultpages()
codewas removed in favor of using the generic kernel provided
iov_iter_fault_in_readable()
interface. Unfortunately, itturns out that up until the Linux 4.7 kernel the function would
only ever fault in the first iovec of the iov_iter. The result
being
uiomove_iov()
may hang waiting for the page.This commit effectively restores the custom
uio_prefaultpages()
pages code for Linux 4.9 and earlier kernels which contain the
troublesome version of
iov_iter_fault_in_readable()
.How Has This Been Tested?
Using the Postgres reproducer provided in issue #11463. Without
the patch applied I'm able to easily reproduce the issue. With the
change applied I can create the database on ZFS without any issue.
Note: I still need to confirm that there isn't an issue on 4.9 and newer kernels.I don't expect there to be an any issue, but it needs to be verified. In the
meanwhile I wanted to get the PR open for testing.
I've verified that the postgres test case works correctly for me on a
Fedora 5.10.8-200.fc33.x86_64 kernel both with and without the patch
applied. This was as expected.
Types of changes
Checklist:
Signed-off-by
.