From: Mike Christie <michaelc@cs.wisc.edu>
To: Linux Kernel <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@suse.de>
Subject: [PATCH] catch error when completing bio pairs
Date: Mon, 22 Mar 2004 23:19:29 -0800 [thread overview]
Message-ID: <405FE501.6030704@cs.wisc.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
A couple of drivers can sometimes fail the first
segments in a bio then requeue the rest of the request. In this
situation, if the last part of the bio completes successfully
bio_pair_end_* will miss that the beginging of the bio had
failed becuase they just return one when bi_size is not yet
zero. The attached patch moves the error value test before
the bi_size to catch the above case.
Mike Christie
[-- Attachment #2: biopair-err.patch --]
[-- Type: text/plain, Size: 675 bytes --]
--- linux-2.6.5-rc2/fs/bio.c 2004-03-22 22:44:28.000000000 -0800
+++ linux-2.6.5-rc2-ec/fs/bio.c 2004-03-22 23:00:18.000000000 -0800
@@ -701,11 +701,12 @@ static int bio_pair_end_1(struct bio * b
{
struct bio_pair *bp = container_of(bi, struct bio_pair, bio1);
- if (bi->bi_size)
- return 1;
if (err)
bp->error = err;
+ if (bi->bi_size)
+ return 1;
+
bio_pair_release(bp);
return 0;
}
@@ -714,11 +715,12 @@ static int bio_pair_end_2(struct bio * b
{
struct bio_pair *bp = container_of(bi, struct bio_pair, bio2);
- if (bi->bi_size)
- return 1;
if (err)
bp->error = err;
+ if (bi->bi_size)
+ return 1;
+
bio_pair_release(bp);
return 0;
}
next reply other threads:[~2004-03-23 7:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-23 7:19 Mike Christie [this message]
2004-03-24 8:29 ` [PATCH] catch error when completing bio pairs Jens Axboe
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=405FE501.6030704@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.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 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.