/* if we're here, all write(s) have completed, so clean up */ 
static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio){	conf_t *conf = mddev_to_conf(mddev);	int i;	int disks = conf->raid_disks;	struct bio *bio, *wbio;	bio = r1_bio->bios[r1_bio->read_disk];	/*	 * schedule writes	 */	if (!test_bit(R1BIO_Uptodate, &r1_bio->state)) {		/*		 * There is no point trying a read-for-reconstruct as		 * reconstruct is about to be aborted		 */		char b[BDEVNAME_SIZE];		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);		md_done_sync(mddev, r1_bio->sectors, 0);		put_buf(r1_bio);		return;	}	atomic_set(&r1_bio->remaining, 1);	for (i = 0; i < disks ; i++) {		wbio = r1_bio->bios[i];		if (wbio->bi_end_io != end_sync_write)			continue;		atomic_inc(&conf->mirrors[i].rdev->nr_pending);		atomic_inc(&r1_bio->remaining);		md_sync_acct(conf->mirrors[i].rdev->bdev, wbio->bi_size >> 9);		generic_make_request(wbio);	}	if (atomic_dec_and_test(&r1_bio->remaining)) {		md_done_sync(mddev, r1_bio->sectors, 1);		put_buf(r1_bio);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/191ea9b2c7cc3ebbe0678834ab710d7d95ad3f9a/raid1.c/buggy/drivers/md/raid1.c