Commit 4d26d32f authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Song Liu

md: don't destroy serial_info_pool if serialize_policy is true

The serial_info_pool is needed if array sets serialize_policy to
true, so don't destroy it.
Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent 69df9cfc
......@@ -1789,8 +1789,10 @@ void md_bitmap_destroy(struct mddev *mddev)
return;
md_bitmap_wait_behind_writes(mddev);
mempool_destroy(mddev->serial_info_pool);
mddev->serial_info_pool = NULL;
if (!mddev->serialize_policy) {
mempool_destroy(mddev->serial_info_pool);
mddev->serial_info_pool = NULL;
}
mutex_lock(&mddev->bitmap_info.mutex);
spin_lock(&mddev->lock);
......@@ -2476,8 +2478,10 @@ backlog_store(struct mddev *mddev, const char *buf, size_t len)
mddev->bitmap_info.max_write_behind = backlog;
if (!backlog && mddev->serial_info_pool) {
/* serial_info_pool is not needed if backlog is zero */
mempool_destroy(mddev->serial_info_pool);
mddev->serial_info_pool = NULL;
if (!mddev->serialize_policy) {
mempool_destroy(mddev->serial_info_pool);
mddev->serial_info_pool = NULL;
}
} else if (backlog && !mddev->serial_info_pool) {
/* serial_info_pool is needed since backlog is not zero */
struct md_rdev *rdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment