Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71711
b: refs/heads/master
c: a72cf73
h: refs/heads/master
i:
  71709: e084cdb
  71707: 1e63259
  71703: 570f05d
  71695: 32a2352
  71679: f5fb021
v: v3
  • Loading branch information
Dmitry Monakhov authored and Alasdair G Kergon committed Oct 20, 2007
1 parent 57f1ab3 commit b2d47d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 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: 815f9e32709b014a459919176a4f0feebd42731e
refs/heads/master: a72cf737e09da409e047863e38410930dae5fe05
28 changes: 15 additions & 13 deletions trunk/drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ static struct mirror_set *alloc_context(unsigned int nr_mirrors,

if (rh_init(&ms->rh, ms, dl, region_size, ms->nr_regions)) {
ti->error = "Error creating dirty region hash";
dm_io_client_destroy(ms->io_client);
kfree(ms);
return NULL;
}
Expand Down Expand Up @@ -1163,16 +1164,14 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
ms->kmirrord_wq = create_singlethread_workqueue("kmirrord");
if (!ms->kmirrord_wq) {
DMERR("couldn't start kmirrord");
free_context(ms, ti, m);
return -ENOMEM;
r = -ENOMEM;
goto err_free_context;
}
INIT_WORK(&ms->kmirrord_work, do_mirror);

r = parse_features(ms, argc, argv, &args_used);
if (r) {
free_context(ms, ti, ms->nr_mirrors);
return r;
}
if (r)
goto err_destroy_wq;

argv += args_used;
argc -= args_used;
Expand All @@ -1188,19 +1187,22 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)

if (argc) {
ti->error = "Too many mirror arguments";
free_context(ms, ti, ms->nr_mirrors);
return -EINVAL;
r = -EINVAL;
goto err_destroy_wq;
}

r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
if (r) {
destroy_workqueue(ms->kmirrord_wq);
free_context(ms, ti, ms->nr_mirrors);
return r;
}
if (r)
goto err_destroy_wq;

wake(ms);
return 0;

err_destroy_wq:
destroy_workqueue(ms->kmirrord_wq);
err_free_context:
free_context(ms, ti, ms->nr_mirrors);
return r;
}

static void mirror_dtr(struct dm_target *ti)
Expand Down

0 comments on commit b2d47d3

Please sign in to comment.