From: Christoph Hellwig Date: Tue, 3 Nov 2020 10:00:10 +0000 (+0100) Subject: block: don't call into the driver for BLKFLSBUF X-Git-Tag: v5.15~2162^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a9d6d667f0bafed55a9e9f5ae8bceb3680749d7;p=platform%2Fkernel%2Flinux-starfive.git block: don't call into the driver for BLKFLSBUF BLKFLSBUF is entirely contained in the block core, and there is no good reason to give the driver a hook into processing it. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/ioctl.c b/block/ioctl.c index 3fbc382..c6d8863 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -369,15 +369,8 @@ 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;