From: Badari Pulavarty <pbadari@gmail.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>, suparna@in.ibm.com
Subject: Re: [patch] bug fix in dio handling write error
Date: Tue, 17 Jan 2006 15:27:41 -0800 [thread overview]
Message-ID: <1137540461.4966.155.camel@dyn9047017102.beaverton.ibm.com> (raw)
In-Reply-To: <200601171941.k0HJfwg14084@unix-os.sc.intel.com>
On Tue, 2006-01-17 at 11:41 -0800, Chen, Kenneth W wrote:
> There is a bug in direct-io on propagating write error up to the
> higher I/O layer. When performing an async ODIRECT write to a
> block device, if a device error occurred (like media error or disk
> is pulled), the error code is only propagated from device driver
> to the DIO layer. The error code stops at finished_one_bio(). The
> aysnc write, however, is supposedly have a corresponding AIO event
> with appropriate return code (in this case -EIO). Application
> which waits on the async write event, will hang forever since such
> AIO event is lost forever (if such app did not use the timeout
> option in io_getevents call. Regardless, an AIO event is lost).
>
> The problem is that calls to aio_complete() is conditioned upon
> READ, but it should've handle WRITE error as well.
>
>
> Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
>
>
> --- linux-2.6.15/fs/direct-io.c.orig 2006-01-17 11:54:17.010422462 -0800
> +++ linux-2.6.15/fs/direct-io.c 2006-01-17 12:08:00.444982688 -0800
> @@ -253,8 +253,7 @@ static void finished_one_bio(struct dio
> dio_complete(dio, offset, transferred);
>
> /* Complete AIO later if falling back to buffered i/o */
> - if (dio->result == dio->size ||
> - ((dio->rw == READ) && dio->result)) {
> + if (dio->result == dio->size || dio->result) {
> aio_complete(dio->iocb, transferred, 0);
> kfree(dio);
> return;
>
>
I vaguely remember adding the explicit "dio->rw == READ" check for a
reason (which escapes me right now). Suparna, do you remember ? Let me
think and get back to you.
Thanks,
Badari
prev parent reply other threads:[~2006-01-17 23:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-17 19:41 Chen, Kenneth W
2006-01-17 23:27 ` Badari Pulavarty [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=1137540461.4966.155.camel@dyn9047017102.beaverton.ibm.com \
--to=pbadari@gmail.com \
--cc=kenneth.w.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=suparna@in.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
all inboxes | Powered by JetHome®