Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176524
b: refs/heads/master
c: 0f398a8
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 1814a37 commit 93ea5f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04788507686d184d8166918b70ef52311bc36dcb
refs/heads/master: 0f398a8403e31c737b429fddc3850093d0bf58d0
34 changes: 9 additions & 25 deletions trunk/drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,20 +745,12 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures)
{
struct bio *bio;

if (!failures->head)
if (likely(!failures->head))
return;

if (!ms->log_failure) {
while ((bio = bio_list_pop(failures))) {
ms->in_sync = 0;
dm_rh_mark_nosync(ms->rh, bio, bio->bi_size, 0);
}
return;
}

/*
* If the log has failed, unattempted writes are being
* put on the failures list. We can't issue those writes
* put on the holds list. We can't issue those writes
* until a log has been marked, so we must store them.
*
* If a 'noflush' suspend is in progress, we can requeue
Expand All @@ -773,23 +765,15 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures)
* for us to treat them the same and requeue them
* as well.
*/
if (dm_noflush_suspending(ms->ti)) {
while ((bio = bio_list_pop(failures)))
bio_endio(bio, DM_ENDIO_REQUEUE);
return;
}

if (atomic_read(&ms->suspend)) {
while ((bio = bio_list_pop(failures)))
bio_endio(bio, -EIO);
return;
while ((bio = bio_list_pop(failures))) {
if (ms->log_failure)
hold_bio(ms, bio);
else {
ms->in_sync = 0;
dm_rh_mark_nosync(ms->rh, bio, bio->bi_size, 0);
}
}

spin_lock_irq(&ms->lock);
bio_list_merge(&ms->failures, failures);
spin_unlock_irq(&ms->lock);

delayed_wake(ms);
}

static void trigger_event(struct work_struct *work)
Expand Down

0 comments on commit 93ea5f2

Please sign in to comment.