Skip to content
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

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

awhitcroft
Copy link

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

…anipulation

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 facebookarchive#215.

fixes: facebookarchive#215
Signed-off-by: Andy Whitcroft <apw@ubuntu.com>
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@SwooshyCueb
Copy link

So with this PR and PR #213, will flashcache build against 4.4 and work as before?

Also, it looks like you still need to sign the CLA

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jkkm jkkm merged commit 662f48c into facebookarchive:master Aug 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux 4.4 build failure.
4 participants