rdev->in_sync = 1; rdev->faulty = 0; 
set_bit(In_sync, &rdev->flags); 
static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev){	struct mdp_superblock_1 *sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);	rdev->raid_disk = -1;	rdev->in_sync = 0;	if (mddev->raid_disks == 0) {		mddev->major_version = 1;		mddev->patch_version = 0;		mddev->persistent = 1;		mddev->chunk_size = le32_to_cpu(sb->chunksize) << 9;		mddev->ctime = le64_to_cpu(sb->ctime) & ((1ULL << 32)-1);		mddev->utime = le64_to_cpu(sb->utime) & ((1ULL << 32)-1);		mddev->level = le32_to_cpu(sb->level);		mddev->layout = le32_to_cpu(sb->layout);		mddev->raid_disks = le32_to_cpu(sb->raid_disks);		mddev->size = le64_to_cpu(sb->size)/2;		mddev->events = le64_to_cpu(sb->events);		mddev->bitmap_offset = 0;		mddev->default_bitmap_offset = 0;		mddev->default_bitmap_offset = 1024;				mddev->recovery_cp = le64_to_cpu(sb->resync_offset);		memcpy(mddev->uuid, sb->set_uuid, 16);		mddev->max_disks =  (4096-256)/2;		if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET) &&		    mddev->bitmap_file == NULL ) {			if (mddev->level != 1) {				printk(KERN_WARNING "md: bitmaps only supported for raid1\n");				return -EINVAL;			}			mddev->bitmap_offset = (__s32)le32_to_cpu(sb->bitmap_offset);		}	} else if (mddev->pers == NULL) {		/* Insist of good event counter while assembling */		__u64 ev1 = le64_to_cpu(sb->events);		++ev1;		if (ev1 < mddev->events)			return -EINVAL;	} else if (mddev->bitmap) {		/* If adding to array with a bitmap, then we can accept an		 * older device, but not too old.		 */		__u64 ev1 = le64_to_cpu(sb->events);		if (ev1 < mddev->bitmap->events_cleared)			return 0;	} else /* just a hot-add of a new device, leave raid_disk at -1 */		return 0;	if (mddev->level != LEVEL_MULTIPATH) {		int role;		rdev->desc_nr = le32_to_cpu(sb->dev_number);		role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);		switch(role) {		case 0xffff: /* spare */			rdev->faulty = 0;			break;		case 0xfffe: /* faulty */			rdev->faulty = 1;			break;		default:			rdev->in_sync = 1;			rdev->faulty = 0;			rdev->raid_disk = role;			break;		}		rdev->flags = 0;		if (sb->devflags & WriteMostly1)			set_bit(WriteMostly, &rdev->flags);	} else /* MULTIPATH are always insync */		rdev->in_sync = 1;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b2d444d7ad975d555bb919601bcdc0e58975a40e/md.c/buggy/drivers/md/md.c