]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit - block/blk-lib.c
block: add bdev_read_only() checks to common helpers
authorIlya Dryomov <idryomov@gmail.com>
Thu, 11 Jan 2018 13:09:12 +0000 (14:09 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Jan 2018 19:57:19 +0000 (12:57 -0700)
commita13553c777375009584741e7d9982e775c4b0744
tree2bba1cbb952f6cf35eef08c9dd28d6bd56ec5c72
parent721c7fc701c71f693307d274d2b346a1ecd4a534
block: add bdev_read_only() checks to common helpers

Similar to blkdev_write_iter(), return -EPERM if the partition is
read-only.  This covers ioctl(), fallocate() and most in-kernel users
but isn't meant to be exhaustive -- everything else will be caught in
generic_make_request_checks(), fail with -EIO and can be fixed later.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-lib.c