diff options
author | Luca Berra <bluca@comedia.it> | 2006-10-16 07:26:53 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-10-16 07:26:53 +0200 |
commit | 435d4ebb2e39fec062e201d287e8f73369291522 (patch) | |
tree | e545579e6e07580ada3237aef9e9bf72bce4dc25 /mdassemble.c | |
parent | Reduce max bitmap size when bitmap is in a file. (diff) | |
download | mdadm-435d4ebb2e39fec062e201d287e8f73369291522.tar.xz mdadm-435d4ebb2e39fec062e201d287e8f73369291522.zip |
Mdassemble improvements
From: Luca Berra <bluca@comedia.it>
- Fix a bug where mdassemble didn't close a filedescriptor and so couldn't assembele
stacked arrays.
- Allow mdassemble, when run a second time, to mark all arrays as writable.
This is useful if they are started read-only as is best at boot-time.
Diffstat (limited to 'mdassemble.c')
-rw-r--r-- | mdassemble.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mdassemble.c b/mdassemble.c index 1de5688d..9926dde2 100644 --- a/mdassemble.c +++ b/mdassemble.c @@ -91,13 +91,14 @@ int main(int argc, char *argv[]) { rv |= 1; continue; } - if (ioctl(mdfd, GET_ARRAY_INFO, &array)>=0) - /* already assembled, skip */ - continue; - rv |= Assemble(array_list->st, array_list->devname, mdfd, - array_list, - NULL, NULL, + if (ioctl(mdfd, GET_ARRAY_INFO, &array) < 0) { + rv |= Assemble(array_list->st, array_list->devname, mdfd, + array_list, NULL, NULL, readonly, runstop, NULL, NULL, verbose, force); + } else { + rv |= Manage_ro(array_list->devname, mdfd, -1); /* make it readwrite */ + } + close(mdfd); } return rv; } |