aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-09-08 11:33:35 -0400
committerJens Axboe <axboe@fb.com>2015-09-11 11:03:45 -0400
commit87a816df537e096d404add543ef47b796906c130 (patch)
treeae4d2c8c2606303f9ff4407a748fb48a111b7520
parent7f39add3b08cbbdb99abe50e6d7c342e6800d684 (diff)
block: Refuse adding appending a gapped integrity page to a bio
This is only theoretical at the moment given that the only subsystems that generate integrity payloads are the block layer itself and the scsi target (which generate well aligned integrity payloads). But when we will expose integrity meta-data to user-space, we'll need to refuse appending a page with a gap (if the queue virtual boundary is set). Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/bio-integrity.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 4aecca79374a..14b8faf8b09d 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -140,6 +140,11 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
140 140
141 iv = bip->bip_vec + bip->bip_vcnt; 141 iv = bip->bip_vec + bip->bip_vcnt;
142 142
143 if (bip->bip_vcnt &&
144 bvec_gap_to_prev(bdev_get_queue(bio->bi_bdev),
145 &bip->bip_vec[bip->bip_vcnt - 1], offset))
146 return 0;
147
143 iv->bv_page = page; 148 iv->bv_page = page;
144 iv->bv_len = len; 149 iv->bv_len = len;
145 iv->bv_offset = offset; 150 iv->bv_offset = offset;