]> git.baikalelectronics.ru Git - kernel.git/commit
md: check for NULL ->meta_bdev before calling bdev_read_only
authorChristoph Hellwig <hch@lst.de>
Mon, 1 Feb 2021 13:17:20 +0000 (14:17 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Feb 2021 16:35:20 +0000 (09:35 -0700)
commit544c2b7a8c37a2c3efd51710bcef646c9044df4e
treee4b2120d2e9bfd876081495d7611d51690657ae5
parent5cc9835e90dea294b69948d3e359f7828ae71aba
md: check for NULL ->meta_bdev before calling bdev_read_only

->meta_bdev is optional and not set for most arrays.  Add a
rdev_read_only helper that calls bdev_read_only for both devices
in a safe way.

Fixes: 7eaccfc480cb ("block: remove the NULL bdev check in bdev_read_only")
Reported-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/md.c