diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 17:37:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 17:37:34 -0400 |
commit | dc6f962eb5ad728086fcfa9967976e93ed68e0a5 (patch) | |
tree | d2adb4cd62554b506f1fc84c1264ab3395fa958a /drivers | |
parent | 61f953cbaae26f930b8d937366270547e08c1290 (diff) | |
parent | 070dc6dd7103b6b3f7e4d46e754354a5c15f366e (diff) |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: resolve confusion of MD_CHANGE_CLEAN
md: don't clear MD_CHANGE_CLEAN in md_update_sb() for external arrays
Move .gitignore from drivers/md to lib/raid6
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/.gitignore | 4 | ||||
-rw-r--r-- | drivers/md/bitmap.c | 3 | ||||
-rw-r--r-- | drivers/md/md.c | 25 | ||||
-rw-r--r-- | drivers/md/md.h | 2 |
4 files changed, 12 insertions, 22 deletions
diff --git a/drivers/md/.gitignore b/drivers/md/.gitignore deleted file mode 100644 index a7afec6b19c6..000000000000 --- a/drivers/md/.gitignore +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | mktables | ||
2 | raid6altivec*.c | ||
3 | raid6int*.c | ||
4 | raid6tables.c | ||
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 1ba1e122e948..ed4900ade93a 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1542,8 +1542,7 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) | |||
1542 | atomic_read(&bitmap->mddev->recovery_active) == 0); | 1542 | atomic_read(&bitmap->mddev->recovery_active) == 0); |
1543 | 1543 | ||
1544 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; | 1544 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; |
1545 | if (bitmap->mddev->persistent) | 1545 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); |
1546 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); | ||
1547 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); | 1546 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); |
1548 | s = 0; | 1547 | s = 0; |
1549 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { | 1548 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { |
diff --git a/drivers/md/md.c b/drivers/md/md.c index c148b6302154..43cf9cc9c1df 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2167,9 +2167,9 @@ repeat: | |||
2167 | rdev->recovery_offset = mddev->curr_resync_completed; | 2167 | rdev->recovery_offset = mddev->curr_resync_completed; |
2168 | 2168 | ||
2169 | } | 2169 | } |
2170 | if (mddev->external || !mddev->persistent) { | 2170 | if (!mddev->persistent) { |
2171 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
2172 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | 2171 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); |
2172 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
2173 | wake_up(&mddev->sb_wait); | 2173 | wake_up(&mddev->sb_wait); |
2174 | return; | 2174 | return; |
2175 | } | 2175 | } |
@@ -2178,7 +2178,6 @@ repeat: | |||
2178 | 2178 | ||
2179 | mddev->utime = get_seconds(); | 2179 | mddev->utime = get_seconds(); |
2180 | 2180 | ||
2181 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
2182 | if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags)) | 2181 | if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags)) |
2183 | force_change = 1; | 2182 | force_change = 1; |
2184 | if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 2183 | if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags)) |
@@ -3371,7 +3370,7 @@ array_state_show(mddev_t *mddev, char *page) | |||
3371 | case 0: | 3370 | case 0: |
3372 | if (mddev->in_sync) | 3371 | if (mddev->in_sync) |
3373 | st = clean; | 3372 | st = clean; |
3374 | else if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 3373 | else if (test_bit(MD_CHANGE_PENDING, &mddev->flags)) |
3375 | st = write_pending; | 3374 | st = write_pending; |
3376 | else if (mddev->safemode) | 3375 | else if (mddev->safemode) |
3377 | st = active_idle; | 3376 | st = active_idle; |
@@ -3452,9 +3451,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
3452 | mddev->in_sync = 1; | 3451 | mddev->in_sync = 1; |
3453 | if (mddev->safemode == 1) | 3452 | if (mddev->safemode == 1) |
3454 | mddev->safemode = 0; | 3453 | mddev->safemode = 0; |
3455 | if (mddev->persistent) | 3454 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
3456 | set_bit(MD_CHANGE_CLEAN, | ||
3457 | &mddev->flags); | ||
3458 | } | 3455 | } |
3459 | err = 0; | 3456 | err = 0; |
3460 | } else | 3457 | } else |
@@ -3466,8 +3463,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
3466 | case active: | 3463 | case active: |
3467 | if (mddev->pers) { | 3464 | if (mddev->pers) { |
3468 | restart_array(mddev); | 3465 | restart_array(mddev); |
3469 | if (mddev->external) | 3466 | clear_bit(MD_CHANGE_PENDING, &mddev->flags); |
3470 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
3471 | wake_up(&mddev->sb_wait); | 3467 | wake_up(&mddev->sb_wait); |
3472 | err = 0; | 3468 | err = 0; |
3473 | } else { | 3469 | } else { |
@@ -6572,6 +6568,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
6572 | if (mddev->in_sync) { | 6568 | if (mddev->in_sync) { |
6573 | mddev->in_sync = 0; | 6569 | mddev->in_sync = 0; |
6574 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | 6570 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
6571 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
6575 | md_wakeup_thread(mddev->thread); | 6572 | md_wakeup_thread(mddev->thread); |
6576 | did_change = 1; | 6573 | did_change = 1; |
6577 | } | 6574 | } |
@@ -6580,7 +6577,6 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
6580 | if (did_change) | 6577 | if (did_change) |
6581 | sysfs_notify_dirent_safe(mddev->sysfs_state); | 6578 | sysfs_notify_dirent_safe(mddev->sysfs_state); |
6582 | wait_event(mddev->sb_wait, | 6579 | wait_event(mddev->sb_wait, |
6583 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && | ||
6584 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); | 6580 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); |
6585 | } | 6581 | } |
6586 | 6582 | ||
@@ -6616,6 +6612,7 @@ int md_allow_write(mddev_t *mddev) | |||
6616 | if (mddev->in_sync) { | 6612 | if (mddev->in_sync) { |
6617 | mddev->in_sync = 0; | 6613 | mddev->in_sync = 0; |
6618 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | 6614 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
6615 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
6619 | if (mddev->safemode_delay && | 6616 | if (mddev->safemode_delay && |
6620 | mddev->safemode == 0) | 6617 | mddev->safemode == 0) |
6621 | mddev->safemode = 1; | 6618 | mddev->safemode = 1; |
@@ -6625,7 +6622,7 @@ int md_allow_write(mddev_t *mddev) | |||
6625 | } else | 6622 | } else |
6626 | spin_unlock_irq(&mddev->write_lock); | 6623 | spin_unlock_irq(&mddev->write_lock); |
6627 | 6624 | ||
6628 | if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 6625 | if (test_bit(MD_CHANGE_PENDING, &mddev->flags)) |
6629 | return -EAGAIN; | 6626 | return -EAGAIN; |
6630 | else | 6627 | else |
6631 | return 0; | 6628 | return 0; |
@@ -6823,8 +6820,7 @@ void md_do_sync(mddev_t *mddev) | |||
6823 | atomic_read(&mddev->recovery_active) == 0); | 6820 | atomic_read(&mddev->recovery_active) == 0); |
6824 | mddev->curr_resync_completed = | 6821 | mddev->curr_resync_completed = |
6825 | mddev->curr_resync; | 6822 | mddev->curr_resync; |
6826 | if (mddev->persistent) | 6823 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
6827 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
6828 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); | 6824 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); |
6829 | } | 6825 | } |
6830 | 6826 | ||
@@ -7103,8 +7099,7 @@ void md_check_recovery(mddev_t *mddev) | |||
7103 | mddev->recovery_cp == MaxSector) { | 7099 | mddev->recovery_cp == MaxSector) { |
7104 | mddev->in_sync = 1; | 7100 | mddev->in_sync = 1; |
7105 | did_change = 1; | 7101 | did_change = 1; |
7106 | if (mddev->persistent) | 7102 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
7107 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
7108 | } | 7103 | } |
7109 | if (mddev->safemode == 1) | 7104 | if (mddev->safemode == 1) |
7110 | mddev->safemode = 0; | 7105 | mddev->safemode = 0; |
diff --git a/drivers/md/md.h b/drivers/md/md.h index a953fe2808ae..3931299788dc 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -140,7 +140,7 @@ struct mddev_s | |||
140 | unsigned long flags; | 140 | unsigned long flags; |
141 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | 141 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ |
142 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | 142 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
143 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | 143 | #define MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */ |
144 | 144 | ||
145 | int suspended; | 145 | int suspended; |
146 | atomic_t active_io; | 146 | atomic_t active_io; |