md/bitmap: protect clearing of ->bitmap by mddev->lock
This makes it safe to inspect the struct while holding only the spinlock. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
@@ -1619,7 +1619,9 @@ void bitmap_destroy(struct mddev *mddev)
|
||||
return;
|
||||
|
||||
mutex_lock(&mddev->bitmap_info.mutex);
|
||||
spin_lock(&mddev->lock);
|
||||
mddev->bitmap = NULL; /* disconnect from the md device */
|
||||
spin_unlock(&mddev->lock);
|
||||
mutex_unlock(&mddev->bitmap_info.mutex);
|
||||
if (mddev->thread)
|
||||
mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
|
||||
|
Reference in New Issue
Block a user