SRU Bug 215110

Tim Gardner timg at tpi.com
Mon May 12 14:01:37 UTC 2008


>From 457e5aff59660cd4d73bc8efc74a68ede8e1f8aa Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner at canonical.com>
Date: Mon, 12 May 2008 07:45:59 -0600
Subject: [PATCH] UBUNTU: block: fix blkdev_issue_flush() not detecting and passing EOPNOTSUPP back
 OriginalAuthor: Jens Axboe <jens.axboe at oracle.com>
 OriginalLocation: Upstream commit cc66b4512cae8df4ed1635483210aabf7690ec27
 http://launchpadlibrarian.net/14178083/fix.diff
 Bug: #215110
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Backported by Ante Karamatić <ivoks at grad.hr>

This is important to eg dm, that tries to decide whether to stop using
barriers or not.

Tested as working by Anders Henke <anders.henke at 1und1.de>

Signed-off-by: Jens Axboe <jens.axboe at oracle.com>
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 block/ll_rw_blk.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 8b91994..d6ef802 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -2667,8 +2667,10 @@ EXPORT_SYMBOL(blk_execute_rq);
 
 static void bio_end_empty_barrier(struct bio *bio, int err)
 {
-	if (err)
+	if (err) {
+		set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); 
 		clear_bit(BIO_UPTODATE, &bio->bi_flags);
+	}
 
 	complete(bio->bi_private);
 }
@@ -2717,7 +2719,9 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
 		*error_sector = bio->bi_sector;
 
 	ret = 0;
-	if (!bio_flagged(bio, BIO_UPTODATE))
+	if (bio_flagged(bio, BIO_EOPNOTSUPP)) 
+		ret = -EOPNOTSUPP; 
+	else if (!bio_flagged(bio, BIO_UPTODATE)) 
 		ret = -EIO;
 
 	bio_put(bio);
-- 
1.5.4.3





More information about the kernel-team mailing list