diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index d646f6e444f0..915e84d631a2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1604,11 +1604,8 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) | |||
1604 | mddev->new_chunk_sectors = mddev->chunk_sectors; | 1604 | mddev->new_chunk_sectors = mddev->chunk_sectors; |
1605 | } | 1605 | } |
1606 | 1606 | ||
1607 | if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL) { | 1607 | if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL) |
1608 | set_bit(MD_HAS_JOURNAL, &mddev->flags); | 1608 | set_bit(MD_HAS_JOURNAL, &mddev->flags); |
1609 | if (mddev->recovery_cp == MaxSector) | ||
1610 | set_bit(MD_JOURNAL_CLEAN, &mddev->flags); | ||
1611 | } | ||
1612 | } else if (mddev->pers == NULL) { | 1609 | } else if (mddev->pers == NULL) { |
1613 | /* Insist of good event counter while assembling, except for | 1610 | /* Insist of good event counter while assembling, except for |
1614 | * spares (which don't need an event count) */ | 1611 | * spares (which don't need an event count) */ |
@@ -5851,6 +5848,9 @@ static int get_array_info(struct mddev *mddev, void __user *arg) | |||
5851 | working++; | 5848 | working++; |
5852 | if (test_bit(In_sync, &rdev->flags)) | 5849 | if (test_bit(In_sync, &rdev->flags)) |
5853 | insync++; | 5850 | insync++; |
5851 | else if (test_bit(Journal, &rdev->flags)) | ||
5852 | /* TODO: add journal count to md_u.h */ | ||
5853 | ; | ||
5854 | else | 5854 | else |
5855 | spare++; | 5855 | spare++; |
5856 | } | 5856 | } |
@@ -7610,16 +7610,12 @@ EXPORT_SYMBOL(unregister_md_cluster_operations); | |||
7610 | 7610 | ||
7611 | int md_setup_cluster(struct mddev *mddev, int nodes) | 7611 | int md_setup_cluster(struct mddev *mddev, int nodes) |
7612 | { | 7612 | { |
7613 | int err; | 7613 | if (!md_cluster_ops) |
7614 | 7614 | request_module("md-cluster"); | |
7615 | err = request_module("md-cluster"); | ||
7616 | if (err) { | ||
7617 | pr_err("md-cluster module not found.\n"); | ||
7618 | return -ENOENT; | ||
7619 | } | ||
7620 | |||
7621 | spin_lock(&pers_lock); | 7615 | spin_lock(&pers_lock); |
7616 | /* ensure module won't be unloaded */ | ||
7622 | if (!md_cluster_ops || !try_module_get(md_cluster_mod)) { | 7617 | if (!md_cluster_ops || !try_module_get(md_cluster_mod)) { |
7618 | pr_err("can't find md-cluster module or get it's reference.\n"); | ||
7623 | spin_unlock(&pers_lock); | 7619 | spin_unlock(&pers_lock); |
7624 | return -ENOENT; | 7620 | return -ENOENT; |
7625 | } | 7621 | } |
@@ -7862,6 +7858,7 @@ void md_do_sync(struct md_thread *thread) | |||
7862 | */ | 7858 | */ |
7863 | 7859 | ||
7864 | do { | 7860 | do { |
7861 | int mddev2_minor = -1; | ||
7865 | mddev->curr_resync = 2; | 7862 | mddev->curr_resync = 2; |
7866 | 7863 | ||
7867 | try_again: | 7864 | try_again: |
@@ -7891,10 +7888,14 @@ void md_do_sync(struct md_thread *thread) | |||
7891 | prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE); | 7888 | prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE); |
7892 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && | 7889 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && |
7893 | mddev2->curr_resync >= mddev->curr_resync) { | 7890 | mddev2->curr_resync >= mddev->curr_resync) { |
7894 | printk(KERN_INFO "md: delaying %s of %s" | 7891 | if (mddev2_minor != mddev2->md_minor) { |
7895 | " until %s has finished (they" | 7892 | mddev2_minor = mddev2->md_minor; |
7896 | " share one or more physical units)\n", | 7893 | printk(KERN_INFO "md: delaying %s of %s" |
7897 | desc, mdname(mddev), mdname(mddev2)); | 7894 | " until %s has finished (they" |
7895 | " share one or more physical units)\n", | ||
7896 | desc, mdname(mddev), | ||
7897 | mdname(mddev2)); | ||
7898 | } | ||
7898 | mddev_put(mddev2); | 7899 | mddev_put(mddev2); |
7899 | if (signal_pending(current)) | 7900 | if (signal_pending(current)) |
7900 | flush_signals(current); | 7901 | flush_signals(current); |
@@ -8275,16 +8276,13 @@ no_add: | |||
8275 | static void md_start_sync(struct work_struct *ws) | 8276 | static void md_start_sync(struct work_struct *ws) |
8276 | { | 8277 | { |
8277 | struct mddev *mddev = container_of(ws, struct mddev, del_work); | 8278 | struct mddev *mddev = container_of(ws, struct mddev, del_work); |
8278 | int ret = 0; | ||
8279 | 8279 | ||
8280 | mddev->sync_thread = md_register_thread(md_do_sync, | 8280 | mddev->sync_thread = md_register_thread(md_do_sync, |
8281 | mddev, | 8281 | mddev, |
8282 | "resync"); | 8282 | "resync"); |
8283 | if (!mddev->sync_thread) { | 8283 | if (!mddev->sync_thread) { |
8284 | if (!(mddev_is_clustered(mddev) && ret == -EAGAIN)) | 8284 | printk(KERN_ERR "%s: could not start resync thread...\n", |
8285 | printk(KERN_ERR "%s: could not start resync" | 8285 | mdname(mddev)); |
8286 | " thread...\n", | ||
8287 | mdname(mddev)); | ||
8288 | /* leave the spares where they are, it shouldn't hurt */ | 8286 | /* leave the spares where they are, it shouldn't hurt */ |
8289 | clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); | 8287 | clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); |
8290 | clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); | 8288 | clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); |