aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-03-04 05:47:46 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-03-04 05:47:46 -0500
commitcc66b4512cae8df4ed1635483210aabf7690ec27 (patch)
tree8f96be9db22c086efa3751c5c3a80f0ac6007c9f
parent56d94a37f63ad1c9da3bc8e903f79d0ee1e80170 (diff)
block: fix blkdev_issue_flush() not detecting and passing EOPNOTSUPP back
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@1und1.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--block/blk-barrier.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c
index 6901eedeffce..55c5f1fc4f1f 100644
--- a/block/blk-barrier.c
+++ b/block/blk-barrier.c
@@ -259,8 +259,11 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp)
259 259
260static void bio_end_empty_barrier(struct bio *bio, int err) 260static void bio_end_empty_barrier(struct bio *bio, int err)
261{ 261{
262 if (err) 262 if (err) {
263 if (err == -EOPNOTSUPP)
264 set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
263 clear_bit(BIO_UPTODATE, &bio->bi_flags); 265 clear_bit(BIO_UPTODATE, &bio->bi_flags);
266 }
264 267
265 complete(bio->bi_private); 268 complete(bio->bi_private);
266} 269}
@@ -309,7 +312,9 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
309 *error_sector = bio->bi_sector; 312 *error_sector = bio->bi_sector;
310 313
311 ret = 0; 314 ret = 0;
312 if (!bio_flagged(bio, BIO_UPTODATE)) 315 if (bio_flagged(bio, BIO_EOPNOTSUPP))
316 ret = -EOPNOTSUPP;
317 else if (!bio_flagged(bio, BIO_UPTODATE))
313 ret = -EIO; 318 ret = -EIO;
314 319
315 bio_put(bio); 320 bio_put(bio);