From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: linux-scsi@vger.kernel.org, bharrosh@panasas.com, pw@osc.edu,
fujita.tomonori@lab.ntt.co.jp
Subject: Re: [PATCH] use the cmd_type of a leading request for scsi_init_sgtable
Date: Fri, 25 Jan 2008 20:05:55 -0600 [thread overview]
Message-ID: <1201313155.3119.100.camel@localhost.localdomain> (raw)
In-Reply-To: <20080126095738U.tomof@acm.org>
On Sat, 2008-01-26 at 09:57 +0900, FUJITA Tomonori wrote:
> This is against the scsi-bidi tree.
>
> We need to use the cmd_type of a leading request for scsi_init_sgtable
> to set up scsi_data_buffer:length of a bidi request properly.
>
> An alternative approach is setting the cmd_type of a leading request
> and its bidi request (*1). But the block layer and scsi-ml don't
> expect that the leading request and its sub-requests have the
> different command types.
>
> Note that scsi_debug's XDWRITEREAD_10 support is fine without this
> patch since req->nr_sectors works for it but req->nr_sectors doesn't
> work for everyone.
>
> (*1)
>
> http://www.mail-archive.com/linux-scsi@vger.kernel.org/msg12669.html
>
> =
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] use the cmd_type of a leading request for scsi_init_sgtable
>
> We need to use the cmd_type of a leading request for scsi_init_sgtable
> to set up scsi_data_buffer:length of its bidi request properly.
This seems to be a very convoluted work around for the fact that we
forgot to set the cmd_type on the subordinate request.
Wouldn't this be a better fix?
James
---
diff --git a/block/bsg.c b/block/bsg.c
index 69b0a9d..8917c51 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -279,6 +279,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
goto out;
}
rq->next_rq = next_rq;
+ next_rq->cmd_type = rq->cmd_type;
dxferp = (void*)(unsigned long)hdr->din_xferp;
ret = blk_rq_map_user(q, next_rq, dxferp, hdr->din_xfer_len);
next prev parent reply other threads:[~2008-01-26 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 0:57 [PATCH] use the cmd_type of a leading request for scsi_init_sgtable FUJITA Tomonori
2008-01-26 2:05 ` James Bottomley [this message]
2008-01-26 2:22 ` FUJITA Tomonori
2008-01-26 2:28 ` FUJITA Tomonori
2008-01-26 2:34 ` Pete Wyckoff
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=1201313155.3119.100.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=bharrosh@panasas.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-scsi@vger.kernel.org \
--cc=pw@osc.edu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).