diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-11-02 03:49:08 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-11-02 03:49:08 -0400 |
commit | 51fd77bd9f512ab6cc9df0733ba1caaab89eb957 (patch) | |
tree | fcc46ec04cad61a724eebffeabbecea197abbd89 | |
parent | 5ec140e600b7d6624c657f008833f0e71bd5ef48 (diff) |
[BLOCK] Don't allow empty barriers to be passed down to queues that don't grok them
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/ll_rw_blk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 56f2646612e6..3e4e8bfbe856 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -3221,6 +3221,7 @@ static inline void __generic_make_request(struct bio *bio) | |||
3221 | sector_t old_sector; | 3221 | sector_t old_sector; |
3222 | int ret, nr_sectors = bio_sectors(bio); | 3222 | int ret, nr_sectors = bio_sectors(bio); |
3223 | dev_t old_dev; | 3223 | dev_t old_dev; |
3224 | int err = -EIO; | ||
3224 | 3225 | ||
3225 | might_sleep(); | 3226 | might_sleep(); |
3226 | 3227 | ||
@@ -3248,7 +3249,7 @@ static inline void __generic_make_request(struct bio *bio) | |||
3248 | bdevname(bio->bi_bdev, b), | 3249 | bdevname(bio->bi_bdev, b), |
3249 | (long long) bio->bi_sector); | 3250 | (long long) bio->bi_sector); |
3250 | end_io: | 3251 | end_io: |
3251 | bio_endio(bio, -EIO); | 3252 | bio_endio(bio, err); |
3252 | break; | 3253 | break; |
3253 | } | 3254 | } |
3254 | 3255 | ||
@@ -3283,6 +3284,10 @@ end_io: | |||
3283 | 3284 | ||
3284 | if (bio_check_eod(bio, nr_sectors)) | 3285 | if (bio_check_eod(bio, nr_sectors)) |
3285 | goto end_io; | 3286 | goto end_io; |
3287 | if (bio_empty_barrier(bio) && !q->prepare_flush_fn) { | ||
3288 | err = -EOPNOTSUPP; | ||
3289 | goto end_io; | ||
3290 | } | ||
3286 | 3291 | ||
3287 | ret = q->make_request_fn(q, bio); | 3292 | ret = q->make_request_fn(q, bio); |
3288 | } while (ret); | 3293 | } while (ret); |