This makes it safe to inspect the struct while holding only
the spinlock.
Signed-off-by: NeilBrown <neilb@suse.de>
                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;
 
         *   clearing MD_CHANGE_*
         *   in_sync - and related safemode and MD_CHANGE changes
         *   pers (also protected by reconfig_mutex and pending IO).
+        *   clearing ->bitmap
         */
        spinlock_t                      lock;
        wait_queue_head_t               sb_wait;        /* for waiting on superblock updates */