Revert "block: don't call into the driver for BLKFLSBUF"
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 9 Nov 2022 05:59:27 +0000 (14:59 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 09:35:24 +0000 (18:35 +0900)
Revert that commit for use with the blkdev_flushbuf ioctl.

This reverts commit 4a9d6d667f0bafed55a9e9f5ae8bceb3680749d7.

Change-Id: Ibba5ecdff7c0d3402a220005856a28783c36cc86
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
block/ioctl.c

index c43a732..39b51e6 100644 (file)
@@ -382,8 +382,15 @@ static inline int is_unrecognized_ioctl(int ret)
 static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
                unsigned cmd, unsigned long arg)
 {
+       int ret;
+
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
+
+       ret = __blkdev_driver_ioctl(bdev, mode, cmd, arg);
+       if (!is_unrecognized_ioctl(ret))
+               return ret;
+
        fsync_bdev(bdev);
        invalidate_bdev(bdev);
        return 0;