Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 149919

Summary: highmem.c: fix bio error propagation
Product: Red Hat Enterprise Linux 4 Reporter: Tim Burke <tburke>
Component: kernelAssignee: Alexander Viro <aviro>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: davej, jbaron, poelstra, riel, sct
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2005-514 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-05 12:47:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 154907, 156322    

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

ChangeSet 1.2141, 2004/12/12 23:28:56-08:00, axboe

	[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>
	Signed-off-by: Linus Torvalds <torvalds>



 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 17:27:27 UTC
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 12:47:27 UTC
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