public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Tejun Heo <tj@kernel.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	bharrosh@panasas.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/8] block: fix SG_IO vector request data length handling
Date: Wed, 1 Apr 2009 14:29:42 +0200	[thread overview]
Message-ID: <20090401122942.GF5178@kernel.dk> (raw)
In-Reply-To: <49D35D9F.3000204@kernel.org>

On Wed, Apr 01 2009, Tejun Heo wrote:
> FUJITA Tomonori wrote:
> > On Wed, 1 Apr 2009 13:50:58 +0200
> > Jens Axboe <jens.axboe@oracle.com> wrote:
> > 
> >> On Wed, Apr 01 2009, FUJITA Tomonori wrote:
> >>> On Wed,  1 Apr 2009 20:04:38 +0900
> >>> Tejun Heo <tj@kernel.org> wrote:
> >>>
> >>>> Impact: fix SG_IO behavior such that it matches the documentation
> >>>>
> >>>> SG_IO howto says that if ->dxfer_len and sum of iovec disagress, the
> >>>> shorter one wins.  However, the current implementation returns -EINVAL
> >>>> for such cases.  Trim iovc if it's longer than ->dxfer_len.
> >>> Is that description about sg's SG_IO?
> 
> It looks like it's the closest thing.
> 
> >> The more important question is what sg.c actually does, that's more
> >> important than the documentation.
> 
> The current code would fail it with -EINVAL but after brief look into
> 2.6.12-rc2, it seems like it would use the shorter one.  On direct
> mapping path, it builds considering both lengths and on indirect path
> it doesn't seem to look at the iov supplied till the transfer is
> actually complete using the dxfer_len and then copy out whatever can
> be copied out.
> 
> > Do you think that Doug is a person who makes such mistake? ;)
> > 
> > Seems that sg worked as the howto says. But I think that I broke it
> > when I converted sg to use the block layer. I'll fix it soon.
> > 
> > About this patch, as we know, there are lots of subtle differences
> > between sg's SG_IO and the block's. I'm not sure that it's a good idea
> > to change the behavior of the block's SG_IO.
> 
> I think it's better to make the behavior more consistent.  Using
> shorter dxfer_len can be considered a feature too, so...

It's definitely a good feature, it's how you'd probe lots of scsi
command returns. Setting up the iovec once and passing first a smaller
than a larger dxfer_len would be a perfectly reasonable way to do that.

-- 
Jens Axboe


  reply	other threads:[~2009-04-01 12:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 11:04 [GIT PATCHSET block#for-linus] block: blk-map related fixes Tejun Heo
2009-04-01 11:04 ` [PATCH 1/8] scatterlist: make sure sg_miter_next() doesn't return 0 sized mappings Tejun Heo
2009-04-01 11:04 ` [PATCH 2/8] block: fix SG_IO vector request data length handling Tejun Heo
2009-04-01 11:47   ` FUJITA Tomonori
2009-04-01 11:50     ` Jens Axboe
2009-04-01 12:18       ` FUJITA Tomonori
2009-04-01 12:24         ` Jens Axboe
2009-04-01 12:27         ` Tejun Heo
2009-04-01 12:29           ` Jens Axboe [this message]
2009-04-01 11:04 ` [PATCH 3/8] block: fix queue bounce limit setting Tejun Heo
2009-04-01 11:04 ` [PATCH 4/8] bio: actually inline inline bvecs into bio Tejun Heo
2009-04-01 12:47   ` Jens Axboe
2009-04-01 12:55     ` Tejun Heo
2009-04-01 12:59       ` Jens Axboe
2009-04-01 11:04 ` [PATCH 5/8] bio: fix bio_kmalloc() Tejun Heo
2009-04-01 11:04 ` [PATCH 6/8] bio: remove size/segments limit on bio_{copy|map}_{user|kern}*() Tejun Heo
2009-04-01 11:04 ` [PATCH 7/8] blk-map: let blk_rq_map_user_iov() support null mapping Tejun Heo
2009-04-01 11:54   ` FUJITA Tomonori
2009-04-01 12:03     ` Tejun Heo
2009-04-01 11:04 ` [PATCH 8/8] blk-map: reimplement blk_rq_map_user() using blk_rq_map_user_iov() Tejun Heo
2009-04-01 12:44   ` FUJITA Tomonori
2009-04-01 12:50     ` Tejun Heo
2009-04-01 12:59       ` FUJITA Tomonori
2009-04-01 13:03         ` Tejun Heo
2009-04-01 13:10           ` FUJITA Tomonori
2009-04-01 13:17             ` Tejun Heo
2009-04-01 13:18               ` Tejun Heo
2009-04-01 13:22               ` FUJITA Tomonori
2009-04-01 13:28                 ` Tejun Heo

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=20090401122942.GF5178@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.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