Skip to content

Commit

Permalink
dm raid1: kcopyd should stop on error if errors handled
Browse files Browse the repository at this point in the history
dm-raid1 is setting the 'DM_KCOPYD_IGNORE_ERROR' flag unconditionally
when assigning kcopyd work.  kcopyd is responsible for copying an
assigned section of disk to one or more other disks.  The
'DM_KCOPYD_IGNORE_ERROR' flag affects kcopyd in the following way:

When not set:
kcopyd will immediately stop the copy operation when an error is
encountered.

When set:
kcopyd will try to proceed regardless of errors and try to continue
copying any remaining amount.

Since dm-raid1 tracks regions of the address space that are (or
are not) in sync and it now has the ability to handle these
errors, we can safely enable this optimization.  This optimization
is conditional on whether mirror error handling has been enabled.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Oct 10, 2008
1 parent 6680073 commit f7c83e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,9 @@ static int recover(struct mirror_set *ms, struct region *reg)
}

/* hand to kcopyd */
set_bit(DM_KCOPYD_IGNORE_ERROR, &flags);
if (!errors_handled(ms))
set_bit(DM_KCOPYD_IGNORE_ERROR, &flags);

r = dm_kcopyd_copy(ms->kcopyd_client, &from, ms->nr_mirrors - 1, to,
flags, recovery_complete, reg);

Expand Down

0 comments on commit f7c83e2

Please sign in to comment.