]> git.baikalelectronics.ru Git - kernel.git/commit
memstick/mspro_block: fix handling of read-only devices
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Feb 2022 09:45:12 +0000 (10:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Feb 2022 02:44:24 +0000 (19:44 -0700)
commitf7d570ebaab9ea83c301b1dc578937f6b8caa0ad
tree7ef99f93b46f04c14d73a0e224095133d9b08af6
parentdb42c5d965a0134fb74ed8ac8202ece2e9c26350
memstick/mspro_block: fix handling of read-only devices

Use set_disk_ro to propagate the read-only state to the block layer
instead of checking for it in ->open and leaking a reference in case
of a read-only device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220215094514.3828912-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/memstick/core/mspro_block.c