diff options
author | Neil Brown <neilb@suse.de> | 2005-04-04 05:16:24 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-04-04 05:16:24 +0000 |
commit | d17c1f8cbddb322f61c0b1ab4a06b5539dce4c52 (patch) | |
tree | 8e8ec89ef4bfeb0e10b86f748a4a5cb45e1ae14e /mdadm.c | |
parent | 057bd352c2b754cc0b4c7d582570dc2ebc4b1f9a (diff) | |
download | mdadm-d17c1f8cbddb322f61c0b1ab4a06b5539dce4c52.tar.gz mdadm-d17c1f8cbddb322f61c0b1ab4a06b5539dce4c52.tar.xz mdadm-d17c1f8cbddb322f61c0b1ab4a06b5539dce4c52.zip |
Reverse order of arrays when --stop --scan
so that stacked arrays are stopped properly.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -793,6 +793,16 @@ int main(int argc, char *argv[]) /* apply to all devices in /proc/mdstat */ struct mdstat_ent *ms = mdstat_read(0); struct mdstat_ent *e; + if (devmode == 'S') { + /* reverse order so that arrays made of arrays are stopped properly */ + struct mdstat_ent *sm = NULL; + while ((e=ms) != NULL) { + ms = e->next; + e->next = sm; + sm = e; + } + ms = sm; + } for (e=ms ; e ; e=e->next) { char *name = get_md_name(e->devnum); |