提交 a17184a9 编写于 作者: N NeilBrown 提交者: Linus Torvalds

md: allow an md array to appear with 0 drives if it has external metadata

Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ca388059
...@@ -4647,9 +4647,10 @@ static int md_ioctl(struct inode *inode, struct file *file, ...@@ -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, /* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY,
* RUN_ARRAY, and GET_ and SET_BITMAP_FILE are allowed */ * RUN_ARRAY, and GET_ and SET_BITMAP_FILE are allowed */
if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY if ((!mddev->raid_disks && !mddev->external)
&& cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY
&& cmd != GET_BITMAP_FILE) { && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE
&& cmd != GET_BITMAP_FILE) {
err = -ENODEV; err = -ENODEV;
goto abort_unlock; goto abort_unlock;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册