mddev->bitmap_offset = 0; 
static int do_md_stop(mddev_t * mddev, int ro){	int err = 0;	struct gendisk *disk = mddev->gendisk;	if (mddev->pers) {		if (atomic_read(&mddev->active)>2) {			printk("md: %s still in use.\n",mdname(mddev));			return -EBUSY;		}		if (mddev->sync_thread) {			set_bit(MD_RECOVERY_INTR, &mddev->recovery);			md_unregister_thread(mddev->sync_thread);			mddev->sync_thread = NULL;		}		del_timer_sync(&mddev->safemode_timer);		invalidate_partition(disk, 0);		if (ro) {			err  = -ENXIO;			if (mddev->ro)				goto out;			mddev->ro = 1;		} else {			bitmap_flush(mddev);			wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);			if (mddev->ro)				set_disk_ro(disk, 0);			blk_queue_make_request(mddev->queue, md_fail_request);			mddev->pers->stop(mddev);			module_put(mddev->pers->owner);			mddev->pers = NULL;			if (mddev->ro)				mddev->ro = 0;		}		if (!mddev->in_sync) {			/* mark array as shutdown cleanly */			mddev->in_sync = 1;			md_update_sb(mddev);		}		if (ro)			set_disk_ro(disk, 1);	}	bitmap_destroy(mddev);	if (mddev->bitmap_file) {		atomic_set(&mddev->bitmap_file->f_dentry->d_inode->i_writecount, 1);		fput(mddev->bitmap_file);		mddev->bitmap_file = NULL;	}	/*	 * Free resources if final stop	 */	if (!ro) {		struct gendisk *disk;		printk(KERN_INFO "md: %s stopped.\n", mdname(mddev));		export_array(mddev);		mddev->array_size = 0;		disk = mddev->gendisk;		if (disk)			set_capacity(disk, 0);		mddev->changed = 1;	} else		printk(KERN_INFO "md: %s switched to read-only mode.\n",			mdname(mddev));	err = 0;out:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/9223214e8d757663f366133ba5f9b58aa6b28efb/md.c/buggy/drivers/md/md.c