summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown2008-02-06 10:39:55 +0100
committerLinus Torvalds2008-02-06 19:41:19 +0100
commita17184a911195c274104df98a79bec10f57e735d (patch)
tree786eca010cb2c4495702f983420258c4ef8efbe5 /drivers/md/md.c
parentmd: lock address when changing attributes of component devices (diff)
downloadkernel-qcow2-linux-a17184a911195c274104df98a79bec10f57e735d.tar.gz
kernel-qcow2-linux-a17184a911195c274104df98a79bec10f57e735d.tar.xz
kernel-qcow2-linux-a17184a911195c274104df98a79bec10f57e735d.zip
md: allow an md array to appear with 0 drives if it has external metadata
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 39757566f39b..08e0f8d672c3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4647,9 +4647,10 @@ static int md_ioctl(struct inode *inode, struct file *file,
*/
/* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY,
* RUN_ARRAY, and GET_ and SET_BITMAP_FILE are allowed */
- if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY
- && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE
- && cmd != GET_BITMAP_FILE) {
+ if ((!mddev->raid_disks && !mddev->external)
+ && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY
+ && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE
+ && cmd != GET_BITMAP_FILE) {
err = -ENODEV;
goto abort_unlock;
}