提交 ea43ddd8 编写于 作者: N NeilBrown

md: Allow metadata_version to be updated for externally managed metadata.

For externally managed metadata, the 'metadata_version' sysfs
attribute is really just a channel for user-space programs to
communicate about how the array is being managed.
It can be useful for this to be changed while the array is active.

Normally changes to metadata_version are not permitted while the array
is active.  Change that so that if the metadata is externally managed,
the metadata_version can be changed to a different flavour of external
management.
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 7d3c6f87
...@@ -2943,7 +2943,13 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -2943,7 +2943,13 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len)
{ {
int major, minor; int major, minor;
char *e; char *e;
if (!list_empty(&mddev->disks)) /* Changing the details of 'external' metadata is
* always permitted. Otherwise there must be
* no devices attached to the array.
*/
if (mddev->external && strncmp(buf, "external:", 9) == 0)
;
else if (!list_empty(&mddev->disks))
return -EBUSY; return -EBUSY;
if (cmd_match(buf, "none")) { if (cmd_match(buf, "none")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册