Re: [PATCH RFC 0/4] use scatter lists for all block pc requests and simplify hw handlers

James Bottomley
2005-06-05T14:40:08Z

On Sun, 2005-06-05 at 00:15 -0700, Mike Christie wrote:
> +int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd,
> + int data_direction, void *buffer, unsigned
> bufflen,
> + unsigned char *sense, int timeout, int retries)

Actually, not quite; there are two problems with this

1. We may not be able to compute the command length for vendor specific
commands and the group 3 (variable length command 0x7f).
2. some requests want to set other flags (REQ_FAILFAST mostly).

However, extra arguments should accommodate these.

This:

> + if (!req)

Should be if (IS_ERR(req))

Also, you can't do this (use after free):

> + blk_put_request(req);
> + return req->errors;

Finally, there's coming up with a replacement API for scsi_do_req that
returns via the end_io callback ... since that doesn't do a wait/wake,
perhaps this should be the core API upon which the others are built?

James