Commit 51fd77bd authored by Jens Axboe's avatar Jens Axboe

[BLOCK] Don't allow empty barriers to be passed down to queues that don't grok them

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 5ec140e6
...@@ -3221,6 +3221,7 @@ static inline void __generic_make_request(struct bio *bio) ...@@ -3221,6 +3221,7 @@ static inline void __generic_make_request(struct bio *bio)
sector_t old_sector; sector_t old_sector;
int ret, nr_sectors = bio_sectors(bio); int ret, nr_sectors = bio_sectors(bio);
dev_t old_dev; dev_t old_dev;
int err = -EIO;
might_sleep(); might_sleep();
...@@ -3248,7 +3249,7 @@ static inline void __generic_make_request(struct bio *bio) ...@@ -3248,7 +3249,7 @@ static inline void __generic_make_request(struct bio *bio)
bdevname(bio->bi_bdev, b), bdevname(bio->bi_bdev, b),
(long long) bio->bi_sector); (long long) bio->bi_sector);
end_io: end_io:
bio_endio(bio, -EIO); bio_endio(bio, err);
break; break;
} }
...@@ -3283,6 +3284,10 @@ end_io: ...@@ -3283,6 +3284,10 @@ end_io:
if (bio_check_eod(bio, nr_sectors)) if (bio_check_eod(bio, nr_sectors))
goto end_io; goto end_io;
if (bio_empty_barrier(bio) && !q->prepare_flush_fn) {
err = -EOPNOTSUPP;
goto end_io;
}
ret = q->make_request_fn(q, bio); ret = q->make_request_fn(q, bio);
} while (ret); } while (ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment