]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5-cache: Take mddev_lock in r5c_journal_mode_show()
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 8 Jun 2022 16:27:50 +0000 (10:27 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:31 +0000 (17:14 -0600)
commitc309b40ac63a970efe46e404e11a7001faf435c0
treeb72950b0760d788bf41606906d76542b95df0203
parent202eccf82f376baa5b62dd30397958228c999954
md/raid5-cache: Take mddev_lock in r5c_journal_mode_show()

The mddev->lock spinlock doesn't protect against the removal of
conf->log in r5l_exit_log() so conf->log may be freed before it
is used.

To fix this, take the mddev_lock() insteaad of the mddev->lock spinlock.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid5-cache.c