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>
This commit is contained in:

committed by
Jens Axboe

parent
5e7c4274a7
commit
7f39add3b0
@@ -440,6 +440,9 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req,
|
||||
{
|
||||
if (req_gap_back_merge(req, bio))
|
||||
return 0;
|
||||
if (blk_integrity_rq(req) &&
|
||||
integrity_req_gap_back_merge(req, bio))
|
||||
return 0;
|
||||
if (blk_rq_sectors(req) + bio_sectors(bio) >
|
||||
blk_rq_get_max_sectors(req)) {
|
||||
req->cmd_flags |= REQ_NOMERGE;
|
||||
@@ -461,6 +464,9 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req,
|
||||
|
||||
if (req_gap_front_merge(req, bio))
|
||||
return 0;
|
||||
if (blk_integrity_rq(req) &&
|
||||
integrity_req_gap_front_merge(req, bio))
|
||||
return 0;
|
||||
if (blk_rq_sectors(req) + bio_sectors(bio) >
|
||||
blk_rq_get_max_sectors(req)) {
|
||||
req->cmd_flags |= REQ_NOMERGE;
|
||||
|
Reference in New Issue
Block a user