blk_execute_rq(q, bd_disk, rq); 
blk_execute_rq(q, bd_disk, rq, 0); 
static int sg_scsi_ioctl(struct file *file, request_queue_t *q,			 struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic){	struct request *rq;	int err;	unsigned int in_len, out_len, bytes, opcode, cmdlen;	char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];	/*	 * get in an out lengths, verify they don't exceed a page worth of data	 */	if (get_user(in_len, &sic->inlen))		return -EFAULT;	if (get_user(out_len, &sic->outlen))		return -EFAULT;	if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)		return -EINVAL;	if (get_user(opcode, sic->data))		return -EFAULT;	bytes = max(in_len, out_len);	if (bytes) {		buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);		if (!buffer)			return -ENOMEM;		memset(buffer, 0, bytes);	}	rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);	cmdlen = COMMAND_SIZE(opcode);	/*	 * get command and data to send to device, if any	 */	err = -EFAULT;	rq->cmd_len = cmdlen;	if (copy_from_user(rq->cmd, sic->data, cmdlen))		goto error;	if (copy_from_user(buffer, sic->data + cmdlen, in_len))		goto error;	err = verify_command(file, rq->cmd);	if (err)		goto error;	switch (opcode) {		case SEND_DIAGNOSTIC:		case FORMAT_UNIT:			rq->timeout = FORMAT_UNIT_TIMEOUT;			break;		case START_STOP:			rq->timeout = START_STOP_TIMEOUT;			break;		case MOVE_MEDIUM:			rq->timeout = MOVE_MEDIUM_TIMEOUT;			break;		case READ_ELEMENT_STATUS:			rq->timeout = READ_ELEMENT_STATUS_TIMEOUT;			break;		case READ_DEFECT_DATA:			rq->timeout = READ_DEFECT_DATA_TIMEOUT;			break;		default:			rq->timeout = BLK_DEFAULT_TIMEOUT;			break;	}	memset(sense, 0, sizeof(sense));	rq->sense = sense;	rq->sense_len = 0;	rq->data = buffer;	rq->data_len = bytes;	rq->flags |= REQ_BLOCK_PC;	blk_execute_rq(q, bd_disk, rq);	err = rq->errors & 0xff;	/* only 8 bit SCSI status */	if (err) {		if (rq->sense_len && rq->sense) {			bytes = (OMAX_SB_LEN > rq->sense_len) ?				rq->sense_len : OMAX_SB_LEN;			if (copy_to_user(sic->data, rq->sense, bytes))				err = -EFAULT;		}	} else {		if (copy_to_user(sic->data, buffer, out_len))			err = -EFAULT;	}	error:	kfree(buffer);	blk_put_request(rq);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/994ca9a19616f0d4161a9e825f0835925d522426/scsi_ioctl.c/buggy/drivers/block/scsi_ioctl.c