Commit ece9a0b1 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Khalid Elmously

compat_ioctl: block: handle Persistent Reservations

BugLink: https://bugs.launchpad.net/bugs/1859640

commit b2c0fcd2 upstream.

These were added to blkdev_ioctl() in linux-5.5 but not
blkdev_compat_ioctl, so add them now.

Cc: <stable@vger.kernel.org> # v4.4+
Fixes: bbd3e064 ("block: add an API for Persistent Reservations")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Fold in followup patch from Arnd with missing pr.h header include.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 3cbd92cd
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/elevator.h> #include <linux/elevator.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/pr.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -403,6 +404,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) ...@@ -403,6 +404,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
case BLKTRACETEARDOWN: /* compatible */ case BLKTRACETEARDOWN: /* compatible */
ret = blk_trace_ioctl(bdev, cmd, compat_ptr(arg)); ret = blk_trace_ioctl(bdev, cmd, compat_ptr(arg));
return ret; return ret;
case IOC_PR_REGISTER:
case IOC_PR_RESERVE:
case IOC_PR_RELEASE:
case IOC_PR_PREEMPT:
case IOC_PR_PREEMPT_ABORT:
case IOC_PR_CLEAR:
return blkdev_ioctl(bdev, mode, cmd,
(unsigned long)compat_ptr(arg));
default: default:
if (disk->fops->compat_ioctl) if (disk->fops->compat_ioctl)
ret = disk->fops->compat_ioctl(bdev, mode, cmd, arg); ret = disk->fops->compat_ioctl(bdev, mode, cmd, arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment