aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-05-17 00:53:16 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 10:59:12 -0400
commit7a5febe9ffeecd1e78c5b505260ccc1ef18021b4 (patch)
treef3d61987a3f961f33a77334052805457a2ef2460
parent29ac8e056f2016a8404edc02749d095019aa1f82 (diff)
[PATCH] md: set the unplug_fn and issue_flush_fn for md devices *after* committed to creation
We we set the too early, they may still be in place and possibly get called even though the array didn't get set up properly. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/md/multipath.c8
-rw-r--r--drivers/md/raid1.c7
-rw-r--r--drivers/md/raid10.c6
-rw-r--r--drivers/md/raid5.c7
-rw-r--r--drivers/md/raid6main.c6
5 files changed, 17 insertions, 17 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 4e4bfde3db5d..2ae2d709cb15 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -462,10 +462,6 @@ static int multipath_run (mddev_t *mddev)
462 } 462 }
463 memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks); 463 memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks);
464 464
465 mddev->queue->unplug_fn = multipath_unplug;
466
467 mddev->queue->issue_flush_fn = multipath_issue_flush;
468
469 conf->working_disks = 0; 465 conf->working_disks = 0;
470 ITERATE_RDEV(mddev,rdev,tmp) { 466 ITERATE_RDEV(mddev,rdev,tmp) {
471 disk_idx = rdev->raid_disk; 467 disk_idx = rdev->raid_disk;
@@ -528,6 +524,10 @@ static int multipath_run (mddev_t *mddev)
528 * Ok, everything is just fine now 524 * Ok, everything is just fine now
529 */ 525 */
530 mddev->array_size = mddev->size; 526 mddev->array_size = mddev->size;
527
528 mddev->queue->unplug_fn = multipath_unplug;
529 mddev->queue->issue_flush_fn = multipath_issue_flush;
530
531 return 0; 531 return 0;
532 532
533out_free_conf: 533out_free_conf:
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 83380b5d6593..1db5de52d376 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1197,10 +1197,6 @@ static int run(mddev_t *mddev)
1197 if (!conf->r1bio_pool) 1197 if (!conf->r1bio_pool)
1198 goto out_no_mem; 1198 goto out_no_mem;
1199 1199
1200 mddev->queue->unplug_fn = raid1_unplug;
1201
1202 mddev->queue->issue_flush_fn = raid1_issue_flush;
1203
1204 ITERATE_RDEV(mddev, rdev, tmp) { 1200 ITERATE_RDEV(mddev, rdev, tmp) {
1205 disk_idx = rdev->raid_disk; 1201 disk_idx = rdev->raid_disk;
1206 if (disk_idx >= mddev->raid_disks 1202 if (disk_idx >= mddev->raid_disks
@@ -1282,6 +1278,9 @@ static int run(mddev_t *mddev)
1282 */ 1278 */
1283 mddev->array_size = mddev->size; 1279 mddev->array_size = mddev->size;
1284 1280
1281 mddev->queue->unplug_fn = raid1_unplug;
1282 mddev->queue->issue_flush_fn = raid1_issue_flush;
1283
1285 return 0; 1284 return 0;
1286 1285
1287out_no_mem: 1286out_no_mem:
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index e9dc2876a626..3c37be6423d7 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1639,9 +1639,6 @@ static int run(mddev_t *mddev)
1639 mdname(mddev)); 1639 mdname(mddev));
1640 goto out_free_conf; 1640 goto out_free_conf;
1641 } 1641 }
1642 mddev->queue->unplug_fn = raid10_unplug;
1643
1644 mddev->queue->issue_flush_fn = raid10_issue_flush;
1645 1642
1646 ITERATE_RDEV(mddev, rdev, tmp) { 1643 ITERATE_RDEV(mddev, rdev, tmp) {
1647 disk_idx = rdev->raid_disk; 1644 disk_idx = rdev->raid_disk;
@@ -1713,6 +1710,9 @@ static int run(mddev_t *mddev)
1713 mddev->array_size = size/2; 1710 mddev->array_size = size/2;
1714 mddev->resync_max_sectors = size; 1711 mddev->resync_max_sectors = size;
1715 1712
1713 mddev->queue->unplug_fn = raid10_unplug;
1714 mddev->queue->issue_flush_fn = raid10_issue_flush;
1715
1716 /* Calculate max read-ahead size. 1716 /* Calculate max read-ahead size.
1717 * We need to readahead at least twice a whole stripe.... 1717 * We need to readahead at least twice a whole stripe....
1718 * maybe... 1718 * maybe...
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e96e2a10a9c9..3cb11ac232fa 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1620,9 +1620,6 @@ static int run (mddev_t *mddev)
1620 atomic_set(&conf->active_stripes, 0); 1620 atomic_set(&conf->active_stripes, 0);
1621 atomic_set(&conf->preread_active_stripes, 0); 1621 atomic_set(&conf->preread_active_stripes, 0);
1622 1622
1623 mddev->queue->unplug_fn = raid5_unplug_device;
1624 mddev->queue->issue_flush_fn = raid5_issue_flush;
1625
1626 PRINTK("raid5: run(%s) called.\n", mdname(mddev)); 1623 PRINTK("raid5: run(%s) called.\n", mdname(mddev));
1627 1624
1628 ITERATE_RDEV(mddev,rdev,tmp) { 1625 ITERATE_RDEV(mddev,rdev,tmp) {
@@ -1728,6 +1725,10 @@ memory = conf->max_nr_stripes * (sizeof(struct stripe_head) +
1728 } 1725 }
1729 1726
1730 /* Ok, everything is just fine now */ 1727 /* Ok, everything is just fine now */
1728
1729 mddev->queue->unplug_fn = raid5_unplug_device;
1730 mddev->queue->issue_flush_fn = raid5_issue_flush;
1731
1731 mddev->array_size = mddev->size * (mddev->raid_disks - 1); 1732 mddev->array_size = mddev->size * (mddev->raid_disks - 1);
1732 return 0; 1733 return 0;
1733abort: 1734abort:
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c
index 8a33f351e092..908edd78a792 100644
--- a/drivers/md/raid6main.c
+++ b/drivers/md/raid6main.c
@@ -1779,9 +1779,6 @@ static int run (mddev_t *mddev)
1779 atomic_set(&conf->active_stripes, 0); 1779 atomic_set(&conf->active_stripes, 0);
1780 atomic_set(&conf->preread_active_stripes, 0); 1780 atomic_set(&conf->preread_active_stripes, 0);
1781 1781
1782 mddev->queue->unplug_fn = raid6_unplug_device;
1783 mddev->queue->issue_flush_fn = raid6_issue_flush;
1784
1785 PRINTK("raid6: run(%s) called.\n", mdname(mddev)); 1782 PRINTK("raid6: run(%s) called.\n", mdname(mddev));
1786 1783
1787 ITERATE_RDEV(mddev,rdev,tmp) { 1784 ITERATE_RDEV(mddev,rdev,tmp) {
@@ -1895,6 +1892,9 @@ static int run (mddev_t *mddev)
1895 1892
1896 /* Ok, everything is just fine now */ 1893 /* Ok, everything is just fine now */
1897 mddev->array_size = mddev->size * (mddev->raid_disks - 2); 1894 mddev->array_size = mddev->size * (mddev->raid_disks - 2);
1895
1896 mddev->queue->unplug_fn = raid6_unplug_device;
1897 mddev->queue->issue_flush_fn = raid6_issue_flush;
1898 return 0; 1898 return 0;
1899abort: 1899abort:
1900 if (conf) { 1900 if (conf) {