summaryrefslogtreecommitdiffstats
path: root/block/blk-integrity.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-09-11 09:03:04 -0600
committerJens Axboe <axboe@fb.com>2015-09-11 09:03:04 -0600
commit7f39add3b08cbbdb99abe50e6d7c342e6800d684 (patch)
treedd495ebf5446f531d88aee04f00857cff243e586 /block/blk-integrity.c
parent5e7c4274a70aa2d6f485996d0ca1dad52d0039ca (diff)
downloadlinux-7f39add3b08cbbdb99abe50e6d7c342e6800d684.tar.bz2
block: Refuse request/bio merges with gaps in the integrity payload
If a driver sets the block queue virtual boundary mask, it means that it cannot handle gaps so we must not allow those in the integrity payload as well. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Fixed up by me to have duplicate integrity merge functions, depending on whether block integrity is enabled or not. Fixes a compilations issue with CONFIG_BLK_DEV_INTEGRITY unset. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-integrity.c')
-rw-r--r--block/blk-integrity.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index f548b64be092..75f29cf70188 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -204,6 +204,9 @@ bool blk_integrity_merge_rq(struct request_queue *q, struct request *req,
q->limits.max_integrity_segments)
return false;
+ if (integrity_req_gap_back_merge(req, next->bio))
+ return false;
+
return true;
}
EXPORT_SYMBOL(blk_integrity_merge_rq);