 if (conf->pending_bio_list.head) { bio = bio_list_get(&conf->pending_bio_list); blk_remove_plug(mddev->queue); spin_unlock_irqrestore(&conf->device_lock, flags); /* flush any pending bitmap writes to disk before proceeding w/ I/O */ if (bitmap_unplug(mddev->bitmap) != 0) printk("%s: bitmap file write failed!\n", mdname(mddev));  while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; generic_make_request(bio); bio = next; } unplug = 1;  continue; }  
static void raid1d(mddev_t *mddev){	r1bio_t *r1_bio;	struct bio *bio;	unsigned long flags;	conf_t *conf = mddev_to_conf(mddev);	struct list_head *head = &conf->retry_list;	int unplug=0;	mdk_rdev_t *rdev;	md_check_recovery(mddev);		for (;;) {		char b[BDEVNAME_SIZE];		spin_lock_irqsave(&conf->device_lock, flags);		if (list_empty(head))			break;		r1_bio = list_entry(head->prev, r1bio_t, retry_list);		list_del(head->prev);		spin_unlock_irqrestore(&conf->device_lock, flags);		mddev = r1_bio->mddev;		conf = mddev_to_conf(mddev);		if (test_bit(R1BIO_IsSync, &r1_bio->state)) {			sync_request_write(mddev, r1_bio);			unplug = 1;		} else {			int disk;			bio = r1_bio->bios[r1_bio->read_disk];			if ((disk=read_balance(conf, r1_bio)) == -1) {				printk(KERN_ALERT "raid1: %s: unrecoverable I/O"				       " read error for block %llu\n",				       bdevname(bio->bi_bdev,b),				       (unsigned long long)r1_bio->sector);				raid_end_bio_io(r1_bio);			} else {				r1_bio->bios[r1_bio->read_disk] = NULL;				r1_bio->read_disk = disk;				bio_put(bio);				bio = bio_clone(r1_bio->master_bio, GFP_NOIO);				r1_bio->bios[r1_bio->read_disk] = bio;				rdev = conf->mirrors[disk].rdev;				if (printk_ratelimit())					printk(KERN_ERR "raid1: %s: redirecting sector %llu to"					       " another mirror\n",					       bdevname(rdev->bdev,b),					       (unsigned long long)r1_bio->sector);				bio->bi_sector = r1_bio->sector + rdev->data_offset;				bio->bi_bdev = rdev->bdev;				bio->bi_end_io = raid1_end_read_request;				bio->bi_rw = READ;				bio->bi_private = r1_bio;				unplug = 1;				generic_make_request(bio);			}		}	}	spin_unlock_irqrestore(&conf->device_lock, flags);	if (unplug)		unplug_slaves(mddev);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/191ea9b2c7cc3ebbe0678834ab710d7d95ad3f9a/raid1.c/buggy/drivers/md/raid1.c