--- linux-2.6.24.2-vanilla/block/ll_rw_blk.c 2008-02-11 06:51:11.000000000 +0100 +++ linux-2.6.24.2/block/ll_rw_blk.c 2008-02-28 10:38:22.392987649 +0100 @@ -2667,8 +2667,11 @@ EXPORT_SYMBOL(blk_execute_rq); static void bio_end_empty_barrier(struct bio *bio, int err) { - if (err) + if (err) { + if (err == -EOPNOTSUPP) + set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); clear_bit(BIO_UPTODATE, &bio->bi_flags); + } complete(bio->bi_private); } @@ -2717,7 +2720,9 @@ int blkdev_issue_flush(struct block_devi *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);