summaryrefslogtreecommitdiff
path: root/block/bio-integrity.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bio-integrity.c')
-rw-r--r--block/bio-integrity.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 9e241063a616..dc9b7edf6298 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -137,6 +137,16 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
struct bio_integrity_payload *bip = bio->bi_integrity;
struct bio_vec *iv;
+ if (bip->bip_vcnt) {
+ iv = bip->bip_vec + bip->bip_vcnt - 1;
+
+ if (bvec_to_phys(iv) + iv->bv_len ==
+ page_to_phys(page) + offset) {
+ iv->bv_len += len;
+ return len;
+ }
+ }
+
if (bip->bip_vcnt >= bip_integrity_vecs(bip)) {
printk(KERN_ERR "%s: bip_vec full\n", __func__);
return 0;