summaryrefslogtreecommitdiff
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-12-15 04:56:58 +0300
committerNeilBrown <neilb@suse.de>2015-02-06 01:32:55 +0300
commit978a7a47cae79ae7a7b5a1e80bfcaef6ee700312 (patch)
treef9f479f5a662ddc9cd482d0e46c7e21e3ca3783b /drivers/md/bitmap.c
parent36d091f4759d194c99f0705d412afe208622b45a (diff)
downloadlinux-978a7a47cae79ae7a7b5a1e80bfcaef6ee700312.tar.xz
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>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 1695ee5f3ffc..3424b1915fc4 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -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;