public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Jens Axboe <axboe@suse.de>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: O_DIRECT broken in 2.5.3-preX ?
Date: Mon, 28 Jan 2002 03:06:11 +0100	[thread overview]
Message-ID: <20020128030611.T25170@athlon.random> (raw)
In-Reply-To: <20020115145549.M31878@suse.de> <200201242152.g0OLq4n08807@eng2.beaverton.ibm.com>
In-Reply-To: <200201242152.g0OLq4n08807@eng2.beaverton.ibm.com>; from pbadari@us.ibm.com on Thu, Jan 24, 2002 at 01:52:04PM -0800

On Thu, Jan 24, 2002 at 01:52:04PM -0800, Badari Pulavarty wrote:
> Hi,
> 
> I am reading the O_DIRECT code patch for 2.5.3-pre4. I was wondering
> how is this working in 2.5.X ? Here is my concern:
> 
> generic_direct_IO() creates a blocks[] list and passes it to
> brw_kiovec() with a single kiobuf.
> 	
> 	retval = brw_kiovec(rw, 1, &iobuf, inode->i_dev, blocks, blocksize);
> 
> But brw_kiovec() uses only b[0] to call ll_rw_bio().
> 
> 	for (i = 0; i < nr; i++) {
>                 iobuf = iovec[i];
>                 iobuf->errno = 0;
> 
>                 ll_rw_kio(rw, iobuf, dev, b[i] * (size >> 9));
>         }
> 
> 
> Note that nr = 1 here. ll_rw_kio() uses b[0] as starting sector
> and does the entire IO (for iobuf->length). This is wrong !!!
> It is doing IO from wrong blocks.  Some one should use other 
> block numbers from blocks[] list. Isn't it ?

correct. It seems like somebody broke the semantics of the block field
of brw_kiovec without updating the callers, and furthmore now it is
impossible to use brw_kiovec for O_DIRECT because it is not going to
submit physically contigous I/O.

Andrea

  reply	other threads:[~2002-01-28  2:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 19:56 [PATCH] O_DIRECT with hardware blocksize alignment Joel Becker
2002-01-12 12:31 ` Andrea Arcangeli
2002-01-15  3:21   ` Joel Becker
2002-01-15 12:20     ` Andrea Arcangeli
2002-01-15 13:08       ` Jens Axboe
2002-01-15 13:55         ` Jens Axboe
2002-01-15 21:23           ` Badari Pulavarty
2002-01-15 21:44             ` Alan Cox
2002-01-24  0:44           ` [PATCH] small bugfix for ll_rw_bio() for 2.5.3-pre3 Badari Pulavarty
2002-01-24 21:52           ` O_DIRECT broken in 2.5.3-preX ? Badari Pulavarty
2002-01-28  2:06             ` Andrea Arcangeli [this message]
2002-01-16  0:08       ` [PATCH] O_DIRECT with hardware blocksize alignment Joel Becker

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=20020128030611.T25170@athlon.random \
    --to=andrea@suse.de \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    /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