summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-13 16:15:16 +1100
committerNeilBrown <neilb@suse.de>2008-10-13 16:15:16 +1100
commit2a528478c75b6659188fc2ce0d9543124992fe6c (patch)
treebb190fc4b4429525c568f698b15b03c19d164657 /Manage.c
parente5669f40047ba0a8354418d0af5f7e7d862aaea4 (diff)
downloadmdadm-2a528478c75b6659188fc2ce0d9543124992fe6c.tar.gz
mdadm-2a528478c75b6659188fc2ce0d9543124992fe6c.tar.xz
mdadm-2a528478c75b6659188fc2ce0d9543124992fe6c.zip
Manage: allow adding device that is just large enough to v1.x array.
When adding a device to an array, we check that it is large enough. Currently the check makes sure there is also room for a reasonably sized bitmap. But if the array doesn't have a bitmap, then this test might be too restrictive. So when adding, only insist there is enough space for the current bitmap. When Creating, still require room for the standard sized bitmap. This resolved Debian Bug 500309
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Manage.c b/Manage.c
index 8297708..7b3fabe 100644
--- a/Manage.c
+++ b/Manage.c
@@ -349,14 +349,6 @@ int Manage_subdevs(char *devname, int fd,
if (array.not_persistent == 0) {
- /* Make sure device is large enough */
- if (tst->ss->avail_size(tst, ldsize/512) <
- array_size) {
- fprintf(stderr, Name ": %s not large enough to join array\n",
- dv->devname);
- return 1;
- }
-
/* need to find a sample superblock to copy, and
* a spare slot to use
*/
@@ -386,6 +378,15 @@ int Manage_subdevs(char *devname, int fd,
fprintf(stderr, Name ": cannot find valid superblock in this array - HELP\n");
return 1;
}
+
+ /* Make sure device is large enough */
+ if (tst->ss->avail_size(tst, ldsize/512) <
+ array_size) {
+ fprintf(stderr, Name ": %s not large enough to join array\n",
+ dv->devname);
+ return 1;
+ }
+
/* Possibly this device was recently part of the array
* and was temporarily removed, and is now being re-added.
* If so, we can simply re-add it.