diff options
author | NeilBrown <neilb@suse.de> | 2008-10-12 20:55:11 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-10-12 20:55:11 -0400 |
commit | ea43ddd8491feccf36267349748ea91b1194481e (patch) | |
tree | 89ca77c1f9794994eefa16b76f985b502326cfcd | |
parent | 7d3c6f8717ee6c2bf6cba5fa0bda3b28fbda6015 (diff) |
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: NeilBrown <neilb@suse.de>
-rw-r--r-- | drivers/md/md.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7d8c2bb0a67c..13dd7b276150 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2943,7 +2943,13 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len) | |||
2943 | { | 2943 | { |
2944 | int major, minor; | 2944 | int major, minor; |
2945 | char *e; | 2945 | char *e; |
2946 | if (!list_empty(&mddev->disks)) | 2946 | /* Changing the details of 'external' metadata is |
2947 | * always permitted. Otherwise there must be | ||
2948 | * no devices attached to the array. | ||
2949 | */ | ||
2950 | if (mddev->external && strncmp(buf, "external:", 9) == 0) | ||
2951 | ; | ||
2952 | else if (!list_empty(&mddev->disks)) | ||
2947 | return -EBUSY; | 2953 | return -EBUSY; |
2948 | 2954 | ||
2949 | if (cmd_match(buf, "none")) { | 2955 | if (cmd_match(buf, "none")) { |