summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-11-29 11:28:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-09 10:19:00 +0100
commitfc982b8fbd1022886534393dc71eaff08b659350 (patch)
treed1f9ffa9f95d9a419e575744561fafc6bed91ac1 /block
parent2f7db098b1e267ec37212bc713766cbb7471d9d5 (diff)
downloadlinux-stable-fc982b8fbd1022886534393dc71eaff08b659350.tar.gz
linux-stable-fc982b8fbd1022886534393dc71eaff08b659350.tar.bz2
linux-stable-fc982b8fbd1022886534393dc71eaff08b659350.zip
compat_ioctl: block: handle Persistent Reservations
commit b2c0fcd28772f99236d261509bcd242135677965 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: bbd3e064362e ("block: add an API for Persistent Reservations") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Fold in followup patch from Arnd with missing pr.h header include. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/compat_ioctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 6ca015f92766..413bd5c5380b 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -6,6 +6,7 @@
#include <linux/compat.h>
#include <linux/elevator.h>
#include <linux/hdreg.h>
+#include <linux/pr.h>
#include <linux/slab.h>
#include <linux/syscalls.h>
#include <linux/types.h>
@@ -401,6 +402,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
case BLKTRACETEARDOWN: /* compatible */
ret = blk_trace_ioctl(bdev, cmd, compat_ptr(arg));
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:
if (disk->fops->compat_ioctl)
ret = disk->fops->compat_ioctl(bdev, mode, cmd, arg);