Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-10-02 08:33:51 +0200
committerMichal Kubecek <mkubecek@suse.cz>2018-10-02 08:43:37 +0200
commitd92fd022fda2769bad0a55484b08c747cf9b8aec (patch)
tree454f875b770eee57ccacdecca8d047fca402b4b1
parent146a1cdb1915b0ed0adf41519876f610384887cc (diff)
dm-mpath: do not try to access NULL rq (bsc#1110337).rpm-4.4.156-94.57
-rw-r--r--drivers/md/dm-mpath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index b2a7c7e0ed0e..6d116deb2ba4 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -561,8 +561,11 @@ static int __multipath_map(struct dm_target *ti, struct request *clone,
*/
clone->q = bdev_get_queue(bdev);
clone->rq_disk = bdev->bd_disk;
- clone->cmd_flags = rq->cmd_flags | REQ_NOMERGE;
- clone->cmd_flags |= REQ_FAILFAST_TRANSPORT;
+ if (rq)
+ clone->cmd_flags = rq->cmd_flags;
+ else
+ clone->cmd_flags = 0;
+ clone->cmd_flags |= REQ_NOMERGE | REQ_FAILFAST_TRANSPORT;
} else {
/*
* blk-mq request-based interface; used by both: