From: Jens Axboe <jens.axboe@oracle.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: linux-scsi@vger.kernel.org, dougg@torque.net
Subject: Re: [PATCH 5/6] bsg: replace SG v3 with SG v4
Date: Wed, 20 Dec 2006 11:15:18 +0100 [thread overview]
Message-ID: <20061220101518.GM5010@kernel.dk> (raw)
In-Reply-To: <20061220144311D.fujita.tomonori@lab.ntt.co.jp>
On Wed, Dec 20 2006, FUJITA Tomonori wrote:
> This patch replaces SG v3 in bsg with SG v4 (except for SG_IO).
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> block/bsg.c | 198 ++++++++++++++++++++++++++++++++++++-----------------------
> 1 files changed, 121 insertions(+), 77 deletions(-)
>
> diff --git a/block/bsg.c b/block/bsg.c
> index 53a09a5..6d139d2 100644
> --- a/block/bsg.c
> +++ b/block/bsg.c
> @@ -103,8 +103,8 @@ struct bsg_command {
> struct request *rq;
> struct bio *bio;
> int err;
> - struct sg_io_hdr hdr;
> - struct sg_io_hdr __user *uhdr;
> + struct sg_io_v4 hdr;
> + struct sg_io_v4 __user *uhdr;
> char sense[SCSI_SENSE_BUFFERSIZE];
> };
>
> @@ -235,57 +235,82 @@ static struct bsg_command *bsg_get_comma
> return bc;
> }
>
> +static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
> + struct sg_io_v4 *hdr, int has_write_perm)
> +{
> + memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
> +
> + if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request,
> + hdr->request_len))
> + return -EFAULT;
Strange casting, that should be cleaned up. Also reminds me that the
sg_io_v4 header needs proper __user annotation.
--
Jens Axboe
prev parent reply other threads:[~2006-12-20 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-20 5:43 [PATCH 5/6] bsg: replace SG v3 with SG v4 FUJITA Tomonori
2006-12-20 10:15 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061220101518.GM5010@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=tomof@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.