This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Switch from ioctl to dm target messages for PID blacklist/whitelist manipulation #216
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.
In mainline 4.4 the ioctl() callback in the DM target has been removed
in favour of a prepare_ioctl() which selects the underlying device,
all ioctls are assume to apply to that. In discussions with upstream on
resolving this it was suggested that the correct mechanism for this
kind of target focussed ioctl is actually DM target messages. This
patch converts the blacklist/whitelist manipulation over to these DM
target messages.
It also adds rather primative support to the flashcache_setioctl helper to
switch to DM target messages when the existing ioctls are not supported
(ENOTTY). This is handled by calling out to dmsetup which offers a
message command to form these requests.
I would envisage it would be possible to reduce flashcache_setioctl to a
simple shell script in the future once there is no possibility of these
tools being used with a kernel supporting the ioctl only.
This should fix the hard parts of issue #215.
fixes: #215
Signed-off-by: Andy Whitcroft apw@ubuntu.com