]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5-cache: Drop RCU usage of conf->log
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 8 Jun 2022 16:27:51 +0000 (10:27 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:31 +0000 (17:14 -0600)
commit76fd9cf0770e32f7e14f929bfb1eac43428515c8
tree69312769f828206bc29df5dc90125056bca17131
parent088e29bd2a0a26913f4140a0b17f88264ed7cb7f
md/raid5-cache: Drop RCU usage of conf->log

The only place that uses RCU to access conf->log is in
r5l_log_disk_error(). This function is mostly used in the IO path
and once with mddev_lock() held in raid5_change_consistency_policy().

It is known that the IO will be suspended before the log is freed and
r5l_log_exit() is called with the mddev_lock() held.

This should mean that conf->log can not be freed while the function is
being called, so the RCU protection is not necessary. Drop the
rcu_read_lock() as well as the synchronize_rcu() and
rcu_assign_pointer() usage.

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