diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 05:12:18 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:18 -0400 |
commit | 2761e95fe40ca0d01864310fa4d488d7c5e34e18 (patch) | |
tree | a49245e8ebb022605c5d1ce04948cf4a7f9a5c3b /drivers/md | |
parent | 531fe96364f30879753d46c1f52ab839e12d2e5d (diff) |
dm: process requeue in dm_wq_work
If barrier request was returned with DM_ENDIO_REQUEUE,
requeue it in dm_wq_work instead of dec_pending.
This allows us to correctly handle a situation when some targets
are asking for a requeue and other targets signal an error.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e34d694ddd04..910bce85f443 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -536,9 +536,11 @@ static void dec_pending(struct dm_io *io, int error) | |||
536 | * Target requested pushing back the I/O. | 536 | * Target requested pushing back the I/O. |
537 | */ | 537 | */ |
538 | spin_lock_irqsave(&md->deferred_lock, flags); | 538 | spin_lock_irqsave(&md->deferred_lock, flags); |
539 | if (__noflush_suspending(md)) | 539 | if (__noflush_suspending(md)) { |
540 | bio_list_add_head(&md->deferred, io->bio); | 540 | if (!bio_barrier(io->bio)) |
541 | else | 541 | bio_list_add_head(&md->deferred, |
542 | io->bio); | ||
543 | } else | ||
542 | /* noflush suspend was interrupted. */ | 544 | /* noflush suspend was interrupted. */ |
543 | io->error = -EIO; | 545 | io->error = -EIO; |
544 | spin_unlock_irqrestore(&md->deferred_lock, flags); | 546 | spin_unlock_irqrestore(&md->deferred_lock, flags); |
@@ -1458,6 +1460,11 @@ static void process_barrier(struct mapped_device *md, struct bio *bio) | |||
1458 | 1460 | ||
1459 | if (md->barrier_error != DM_ENDIO_REQUEUE) | 1461 | if (md->barrier_error != DM_ENDIO_REQUEUE) |
1460 | bio_endio(bio, md->barrier_error); | 1462 | bio_endio(bio, md->barrier_error); |
1463 | else { | ||
1464 | spin_lock_irq(&md->deferred_lock); | ||
1465 | bio_list_add_head(&md->deferred, bio); | ||
1466 | spin_unlock_irq(&md->deferred_lock); | ||
1467 | } | ||
1461 | } | 1468 | } |
1462 | 1469 | ||
1463 | /* | 1470 | /* |