Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
- drivers/md/dm.c | 20 ++++++++++++++++----
- 1 file changed, 16 insertions(+), 4 deletions(-)
+ drivers/md/dm.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
-@@ -1487,10 +1487,15 @@ static int dm_prep_fn(struct request_que
+@@ -1487,11 +1487,15 @@ static int dm_prep_fn(struct request_que
return BLKPREP_OK;
}
+ struct mapped_device *md)
{
- int r;
+- struct request *clone = rq->special;
+ int r, requeued = 0;
- struct request *clone = rq->special;
struct dm_rq_target_io *tio = clone->end_io_data;
-@@ -1516,6 +1521,7 @@ static void map_request(struct dm_target
+ /*
+@@ -1516,6 +1520,7 @@ static void map_request(struct dm_target
case DM_MAPIO_REQUEUE:
/* The target wants to requeue the I/O */
dm_requeue_unmapped_request(clone);
break;
default:
if (r > 0) {
-@@ -1527,6 +1533,8 @@ static void map_request(struct dm_target
+@@ -1527,6 +1532,8 @@ static void map_request(struct dm_target
dm_kill_unmapped_request(clone, r);
break;
}
}
/*
-@@ -1568,12 +1576,16 @@ static void dm_request_fn(struct request
+@@ -1568,12 +1575,16 @@ static void dm_request_fn(struct request
blk_start_request(rq);
spin_unlock(q->queue_lock);
- map_request(ti, rq, md);
-+ if (map_request(ti, clone, md))
++ if (map_request(ti, rq, md))
+ goto requeued;
spin_lock_irq(q->queue_lock);
}