Commit dc6f962e authored by Linus Torvalds's avatar Linus Torvalds

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
parents 61f953cb 070dc6dd
mktables
raid6altivec*.c
raid6int*.c
raid6tables.c
...@@ -1542,8 +1542,7 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) ...@@ -1542,8 +1542,7 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector)
atomic_read(&bitmap->mddev->recovery_active) == 0); atomic_read(&bitmap->mddev->recovery_active) == 0);
bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync;
if (bitmap->mddev->persistent) set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags);
set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags);
sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1);
s = 0; s = 0;
while (s < sector && s < bitmap->mddev->resync_max_sectors) { while (s < sector && s < bitmap->mddev->resync_max_sectors) {
......
...@@ -2167,9 +2167,9 @@ static void md_update_sb(mddev_t * mddev, int force_change) ...@@ -2167,9 +2167,9 @@ static void md_update_sb(mddev_t * mddev, int force_change)
rdev->recovery_offset = mddev->curr_resync_completed; rdev->recovery_offset = mddev->curr_resync_completed;
} }
if (mddev->external || !mddev->persistent) { if (!mddev->persistent) {
clear_bit(MD_CHANGE_DEVS, &mddev->flags);
clear_bit(MD_CHANGE_CLEAN, &mddev->flags); clear_bit(MD_CHANGE_CLEAN, &mddev->flags);
clear_bit(MD_CHANGE_DEVS, &mddev->flags);
wake_up(&mddev->sb_wait); wake_up(&mddev->sb_wait);
return; return;
} }
...@@ -2178,7 +2178,6 @@ static void md_update_sb(mddev_t * mddev, int force_change) ...@@ -2178,7 +2178,6 @@ static void md_update_sb(mddev_t * mddev, int force_change)
mddev->utime = get_seconds(); mddev->utime = get_seconds();
set_bit(MD_CHANGE_PENDING, &mddev->flags);
if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags)) if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags))
force_change = 1; force_change = 1;
if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags)) if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags))
...@@ -3371,7 +3370,7 @@ array_state_show(mddev_t *mddev, char *page) ...@@ -3371,7 +3370,7 @@ array_state_show(mddev_t *mddev, char *page)
case 0: case 0:
if (mddev->in_sync) if (mddev->in_sync)
st = clean; st = clean;
else if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) else if (test_bit(MD_CHANGE_PENDING, &mddev->flags))
st = write_pending; st = write_pending;
else if (mddev->safemode) else if (mddev->safemode)
st = active_idle; st = active_idle;
...@@ -3452,9 +3451,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -3452,9 +3451,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len)
mddev->in_sync = 1; mddev->in_sync = 1;
if (mddev->safemode == 1) if (mddev->safemode == 1)
mddev->safemode = 0; mddev->safemode = 0;
if (mddev->persistent) set_bit(MD_CHANGE_CLEAN, &mddev->flags);
set_bit(MD_CHANGE_CLEAN,
&mddev->flags);
} }
err = 0; err = 0;
} else } else
...@@ -3466,8 +3463,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -3466,8 +3463,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len)
case active: case active:
if (mddev->pers) { if (mddev->pers) {
restart_array(mddev); restart_array(mddev);
if (mddev->external) clear_bit(MD_CHANGE_PENDING, &mddev->flags);
clear_bit(MD_CHANGE_CLEAN, &mddev->flags);
wake_up(&mddev->sb_wait); wake_up(&mddev->sb_wait);
err = 0; err = 0;
} else { } else {
...@@ -6572,6 +6568,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi) ...@@ -6572,6 +6568,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
if (mddev->in_sync) { if (mddev->in_sync) {
mddev->in_sync = 0; mddev->in_sync = 0;
set_bit(MD_CHANGE_CLEAN, &mddev->flags); set_bit(MD_CHANGE_CLEAN, &mddev->flags);
set_bit(MD_CHANGE_PENDING, &mddev->flags);
md_wakeup_thread(mddev->thread); md_wakeup_thread(mddev->thread);
did_change = 1; did_change = 1;
} }
...@@ -6580,7 +6577,6 @@ void md_write_start(mddev_t *mddev, struct bio *bi) ...@@ -6580,7 +6577,6 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
if (did_change) if (did_change)
sysfs_notify_dirent_safe(mddev->sysfs_state); sysfs_notify_dirent_safe(mddev->sysfs_state);
wait_event(mddev->sb_wait, wait_event(mddev->sb_wait,
!test_bit(MD_CHANGE_CLEAN, &mddev->flags) &&
!test_bit(MD_CHANGE_PENDING, &mddev->flags)); !test_bit(MD_CHANGE_PENDING, &mddev->flags));
} }
...@@ -6616,6 +6612,7 @@ int md_allow_write(mddev_t *mddev) ...@@ -6616,6 +6612,7 @@ int md_allow_write(mddev_t *mddev)
if (mddev->in_sync) { if (mddev->in_sync) {
mddev->in_sync = 0; mddev->in_sync = 0;
set_bit(MD_CHANGE_CLEAN, &mddev->flags); set_bit(MD_CHANGE_CLEAN, &mddev->flags);
set_bit(MD_CHANGE_PENDING, &mddev->flags);
if (mddev->safemode_delay && if (mddev->safemode_delay &&
mddev->safemode == 0) mddev->safemode == 0)
mddev->safemode = 1; mddev->safemode = 1;
...@@ -6625,7 +6622,7 @@ int md_allow_write(mddev_t *mddev) ...@@ -6625,7 +6622,7 @@ int md_allow_write(mddev_t *mddev)
} else } else
spin_unlock_irq(&mddev->write_lock); spin_unlock_irq(&mddev->write_lock);
if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) if (test_bit(MD_CHANGE_PENDING, &mddev->flags))
return -EAGAIN; return -EAGAIN;
else else
return 0; return 0;
...@@ -6823,8 +6820,7 @@ void md_do_sync(mddev_t *mddev) ...@@ -6823,8 +6820,7 @@ void md_do_sync(mddev_t *mddev)
atomic_read(&mddev->recovery_active) == 0); atomic_read(&mddev->recovery_active) == 0);
mddev->curr_resync_completed = mddev->curr_resync_completed =
mddev->curr_resync; mddev->curr_resync;
if (mddev->persistent) set_bit(MD_CHANGE_CLEAN, &mddev->flags);
set_bit(MD_CHANGE_CLEAN, &mddev->flags);
sysfs_notify(&mddev->kobj, NULL, "sync_completed"); sysfs_notify(&mddev->kobj, NULL, "sync_completed");
} }
...@@ -7103,8 +7099,7 @@ void md_check_recovery(mddev_t *mddev) ...@@ -7103,8 +7099,7 @@ void md_check_recovery(mddev_t *mddev)
mddev->recovery_cp == MaxSector) { mddev->recovery_cp == MaxSector) {
mddev->in_sync = 1; mddev->in_sync = 1;
did_change = 1; did_change = 1;
if (mddev->persistent) set_bit(MD_CHANGE_CLEAN, &mddev->flags);
set_bit(MD_CHANGE_CLEAN, &mddev->flags);
} }
if (mddev->safemode == 1) if (mddev->safemode == 1)
mddev->safemode = 0; mddev->safemode = 0;
......
...@@ -140,7 +140,7 @@ struct mddev_s ...@@ -140,7 +140,7 @@ struct mddev_s
unsigned long flags; unsigned long flags;
#define MD_CHANGE_DEVS 0 /* Some device status has changed */ #define MD_CHANGE_DEVS 0 /* Some device status has changed */
#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */
#define MD_CHANGE_PENDING 2 /* superblock update in progress */ #define MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */
int suspended; int suspended;
atomic_t active_io; atomic_t active_io;
......
mktables
altivec*.c
int*.c
tables.c
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment