summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.c
diff options
context:
space:
mode:
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>2019-12-23 12:48:59 +0300
committerSong Liu <songliubraving@fb.com>2020-01-13 22:44:10 +0300
commit4d26d32fe4dafd29e168addb7c11949a36e7e5f8 (patch)
tree070a1e7360bb63cff5f85e4495f5439c0ad625bc /drivers/md/md-bitmap.c
parent69df9cfc70421fb7949e8f7a19bfc36600b5522b (diff)
downloadlinux-4d26d32fe4dafd29e168addb7c11949a36e7e5f8.tar.xz
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: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md/md-bitmap.c')
-rw-r--r--drivers/md/md-bitmap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 212e75dfebb7..92f0d45946e8 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -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;