aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-02-06 04:39:55 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:19 -0500
commita17184a911195c274104df98a79bec10f57e735d (patch)
tree786eca010cb2c4495702f983420258c4ef8efbe5 /drivers/md
parentca38805945edf5d1f5444b283eed95bb954772e8 (diff)
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')
-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,
4647 */ 4647 */
4648 /* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY, 4648 /* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY,
4649 * RUN_ARRAY, and GET_ and SET_BITMAP_FILE are allowed */ 4649 * RUN_ARRAY, and GET_ and SET_BITMAP_FILE are allowed */
4650 if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY 4650 if ((!mddev->raid_disks && !mddev->external)
4651 && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE 4651 && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY
4652 && cmd != GET_BITMAP_FILE) { 4652 && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE
4653 && cmd != GET_BITMAP_FILE) {
4653 err = -ENODEV; 4654 err = -ENODEV;
4654 goto abort_unlock; 4655 goto abort_unlock;
4655 } 4656 }