Bug 149919 - highmem.c: fix bio error propagation
highmem.c: fix bio error propagation
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Viro
Brian Brock
:
Depends On:
Blocks: 154907 156322
  Show dependency treegraph
 
Reported: 2005-02-28 15:31 EST by Tim Burke
Modified: 2007-11-30 17:07 EST (History)
5 users (show)

See Also:
Fixed In Version: RHSA-2005-514
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-05 08:47:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Tim Burke 2005-02-28 15:31:05 EST
Subject:
[PATCH] highmem.c: fix bio error propagation
From:
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Date:
Mon, 13 Dec 2004 07:28:56 +0000
To:
bk-commits-head@vger.kernel.org

ChangeSet 1.2141, 2004/12/12 23:28:56-08:00, axboe@suse.de

	[PATCH] highmem.c: fix bio error propagation
	
	Found a subtle bug that caused mount errors on a SATA drive with
	barriers on reiser and ext3, where it should have recovered and just
	turned off barriers. The problem is that the EOPNOTSUPP error isn't
	being propagated properly to the bounced bio. This patch fixes that by
	correctly passing error all the way down.
	
	Signed-off-by: Jens Axboe <axboe@suse.de>
	Signed-off-by: Linus Torvalds <torvalds@osdl.org>



 highmem.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)


diff -Nru a/mm/highmem.c b/mm/highmem.c
--- a/mm/highmem.c	2004-12-13 00:05:29 -08:00
+++ b/mm/highmem.c	2004-12-13 00:05:29 -08:00
@@ -305,14 +305,14 @@
 	}
 }
 
-static void bounce_end_io(struct bio *bio, mempool_t *pool)
+static void bounce_end_io(struct bio *bio, mempool_t *pool, int err)
 {
 	struct bio *bio_orig = bio->bi_private;
 	struct bio_vec *bvec, *org_vec;
-	int i, err = 0;
+	int i;
 
-	if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
-		err = -EIO;
+	if (test_bit(BIO_EOPNOTSUPP, &bio->bi_flags))
+		set_bit(BIO_EOPNOTSUPP, &bio_orig->bi_flags);
 
 	/*
 	 * free up bounce indirect pages used
@@ -334,7 +334,7 @@
 	if (bio->bi_size)
 		return 1;
 
-	bounce_end_io(bio, page_pool);
+	bounce_end_io(bio, page_pool, err);
 	return 0;
 }
 
@@ -343,18 +343,18 @@
 	if (bio->bi_size)
 		return 1;
 
-	bounce_end_io(bio, isa_page_pool);
+	bounce_end_io(bio, isa_page_pool, err);
 	return 0;
 }
 
-static void __bounce_end_io_read(struct bio *bio, mempool_t *pool)
+static void __bounce_end_io_read(struct bio *bio, mempool_t *pool, int err)
 {
 	struct bio *bio_orig = bio->bi_private;
 
 	if (test_bit(BIO_UPTODATE, &bio->bi_flags))
 		copy_to_high_bio_irq(bio_orig, bio);
 
-	bounce_end_io(bio, pool);
+	bounce_end_io(bio, pool, err);
 }
 
 static int bounce_end_io_read(struct bio *bio, unsigned int bytes_done, int err)
@@ -362,7 +362,7 @@
 	if (bio->bi_size)
 		return 1;
 
-	__bounce_end_io_read(bio, page_pool);
+	__bounce_end_io_read(bio, page_pool, err);
 	return 0;
 }
 
@@ -371,7 +371,7 @@
 	if (bio->bi_size)
 		return 1;
 
-	__bounce_end_io_read(bio, isa_page_pool);
+	__bounce_end_io_read(bio, isa_page_pool, err);
 	return 0;
 }
Comment 4 Tom Kincaid 2005-07-11 13:27:27 EDT
It would be nice to know what the failure mode for this bugs was. However, I am
giving this an ACK and moving it to the CanFix list. 
Comment 8 Red Hat Bugzilla 2005-10-05 08:47:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-514.html

Note You need to log in before you can comment on or make changes to this bug.