diff options
author | Neil Brown <neilb@suse.de> | 2008-05-27 09:18:53 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-05-27 09:18:53 +1000 |
commit | 77402e51054701cd02ff07f8d5d43ef23e640226 (patch) | |
tree | 9f76dbf1688ce36341ef023d33649a51bb5b176f /monitor.c | |
parent | 75aa18b53cb2df342bc78dd9e44cd0f0c51075f0 (diff) | |
download | mdadm-77402e51054701cd02ff07f8d5d43ef23e640226.tar.gz mdadm-77402e51054701cd02ff07f8d5d43ef23e640226.tar.xz mdadm-77402e51054701cd02ff07f8d5d43ef23e640226.zip |
Discard get_sync_pos. We should be using get_resync_start.
"sync_complete" just tracks the current resync/recover/check/whatever pass.
"resync_start" tracks which parts of the array are known to be in-sync
(modulo active writes). So it is what we need to use to update the metadata.
Also we cannot call it when the array has stopped, as the value is no longer
available then. We must call it when the resync completes.
Possibly also call it preiodically if the array is quiescent.
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -47,22 +47,6 @@ static int read_attr(char *buf, int len, int fd) return n; } -static int get_sync_pos(struct active_array *a) -{ - char buf[30]; - int n; - - n = read_attr(buf, 30, a->sync_pos_fd); - if (n <= 0) - return n; - - if (strncmp(buf, "max", 3) == 0) { - a->sync_pos = ~(unsigned long long)0; - return 1; - } - a->sync_pos = strtoull(buf, NULL, 10); - return 1; -} static int get_resync_start(struct active_array *a) { @@ -248,8 +232,7 @@ static int read_and_act(struct active_array *a) if (a->curr_state <= inactive && a->prev_state > inactive) { /* array has been stopped */ - get_sync_pos(a); - a->container->ss->mark_clean(a, a->sync_pos); + a->container->ss->mark_clean(a, a->resync_start); a->next_state = clear; deactivate = 1; } @@ -285,6 +268,7 @@ static int read_and_act(struct active_array *a) * until the array goes inactive or readonly though. * Just check if we need to fiddle spares. */ + get_resync_start(a); check_degraded = 1; } |