err = get_bitmap_file(mddev, (void *)arg); 
err = get_bitmap_file(mddev, argp); 
static int md_ioctl(struct inode *inode, struct file *file,			unsigned int cmd, unsigned long arg){	int err = 0;	void __user *argp = (void __user *)arg;	struct hd_geometry __user *loc = argp;	mddev_t *mddev = NULL;	if (!capable(CAP_SYS_ADMIN))		return -EACCES;	/*	 * Commands dealing with the RAID driver but not any	 * particular array:	 */	switch (cmd)	{		case RAID_VERSION:			err = get_version(argp);			goto done;		case PRINT_RAID_DEBUG:			err = 0;			md_print_devices();			goto done;#ifndef MODULE		case RAID_AUTORUN:			err = 0;			autostart_arrays(arg);			goto done;#endif		default:;	}	/*	 * Commands creating/starting a new array:	 */	mddev = inode->i_bdev->bd_disk->private_data;	if (!mddev) {		BUG();		goto abort;	}	if (cmd == START_ARRAY) {		/* START_ARRAY doesn't need to lock the array as autostart_array		 * does the locking, and it could even be a different array		 */		static int cnt = 3;		if (cnt > 0 ) {			printk(KERN_WARNING			       "md: %s(pid %d) used deprecated START_ARRAY ioctl. "			       "This will not be supported beyond 2.6\n",			       current->comm, current->pid);			cnt--;		}		err = autostart_array(new_decode_dev(arg));		if (err) {			printk(KERN_WARNING "md: autostart failed!\n");			goto abort;		}		goto done;	}	err = mddev_lock(mddev);	if (err) {		printk(KERN_INFO 			"md: ioctl lock interrupted, reason %d, cmd %d\n",			err, cmd);		goto abort;	}	switch (cmd)	{		case SET_ARRAY_INFO:			{				mdu_array_info_t info;				if (!arg)					memset(&info, 0, sizeof(info));				else if (copy_from_user(&info, argp, sizeof(info))) {					err = -EFAULT;					goto abort_unlock;				}				if (mddev->pers) {					err = update_array_info(mddev, &info);					if (err) {						printk(KERN_WARNING "md: couldn't update"						       " array info. %d\n", err);						goto abort_unlock;					}					goto done_unlock;				}				if (!list_empty(&mddev->disks)) {					printk(KERN_WARNING					       "md: array %s already has disks!\n",					       mdname(mddev));					err = -EBUSY;					goto abort_unlock;				}				if (mddev->raid_disks) {					printk(KERN_WARNING					       "md: array %s already initialised!\n",					       mdname(mddev));					err = -EBUSY;					goto abort_unlock;				}				err = set_array_info(mddev, &info);				if (err) {					printk(KERN_WARNING "md: couldn't set"					       " array info. %d\n", err);					goto abort_unlock;				}			}			goto done_unlock;		default:;	}	/*	 * Commands querying/configuring an existing array:	 */	/* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY,	 * RUN_ARRAY, and SET_BITMAP_FILE are allowed */	if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY			&& cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE) {		err = -ENODEV;		goto abort_unlock;	}	/*	 * Commands even a read-only array can execute:	 */	switch (cmd)	{		case GET_ARRAY_INFO:			err = get_array_info(mddev, argp);			goto done_unlock;		case GET_BITMAP_FILE:			err = get_bitmap_file(mddev, (void *)arg);			goto done_unlock;		case GET_DISK_INFO:			err = get_disk_info(mddev, argp);			goto done_unlock;		case RESTART_ARRAY_RW:			err = restart_array(mddev);			goto done_unlock;		case STOP_ARRAY:			err = do_md_stop (mddev, 0);			goto done_unlock;		case STOP_ARRAY_RO:			err = do_md_stop (mddev, 1);			goto done_unlock;	/*	 * We have a problem here : there is no easy way to give a CHS	 * virtual geometry. We currently pretend that we have a 2 heads	 * 4 sectors (with a BIG number of cylinders...). This drives	 * dosfs just mad... ;-)	 */		case HDIO_GETGEO:			if (!loc) {				err = -EINVAL;				goto abort_unlock;			}			err = put_user (2, (char __user *) &loc->heads);			if (err)				goto abort_unlock;			err = put_user (4, (char __user *) &loc->sectors);			if (err)				goto abort_unlock;			err = put_user(get_capacity(mddev->gendisk)/8,					(short __user *) &loc->cylinders);			if (err)				goto abort_unlock;			err = put_user (get_start_sect(inode->i_bdev),						(long __user *) &loc->start);			goto done_unlock;	}	/*	 * The remaining ioctls are changing the state of the	 * superblock, so we do not allow read-only arrays	 * here:	 */	if (mddev->ro) {		err = -EROFS;		goto abort_unlock;	}	switch (cmd)	{		case ADD_NEW_DISK:		{			mdu_disk_info_t info;			if (copy_from_user(&info, argp, sizeof(info)))				err = -EFAULT;			else				err = add_new_disk(mddev, &info);			goto done_unlock;		}		case HOT_REMOVE_DISK:			err = hot_remove_disk(mddev, new_decode_dev(arg));			goto done_unlock;		case HOT_ADD_DISK:			err = hot_add_disk(mddev, new_decode_dev(arg));			goto done_unlock;		case SET_DISK_FAULTY:			err = set_disk_faulty(mddev, new_decode_dev(arg));			goto done_unlock;		case RUN_ARRAY:			err = do_md_run (mddev);			goto done_unlock;		case SET_BITMAP_FILE:			err = set_bitmap_file(mddev, (int)arg);			goto done_unlock;		default:			if (_IOC_TYPE(cmd) == MD_MAJOR)				printk(KERN_WARNING "md: %s(pid %d) used"					" obsolete MD ioctl, upgrade your"					" software to use new ictls.\n",					current->comm, current->pid);			err = -EINVAL;			goto abort_unlock;	}done_unlock:abort_unlock:	mddev_unlock(mddev);	return err;done:	if (err)		MD_BUG();abort:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/87162a28acceda05dadf10a8333183f6d2b55265/md.c/buggy/drivers/md/md.c