summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-13 11:55:11 +1100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-02-12 09:31:12 -0800
commit1d338dafbacdc12aab149c441e67150a5aed320d (patch)
tree3bd5561a076eb4e1cd46325150c4103ee09583c0 /drivers/md/md.c
parent2dcee68b26a8c19dc08e594604db4ac129d495ed (diff)
downloadlinux-stable-1d338dafbacdc12aab149c441e67150a5aed320d.tar.gz
linux-stable-1d338dafbacdc12aab149c441e67150a5aed320d.tar.bz2
linux-stable-1d338dafbacdc12aab149c441e67150a5aed320d.zip
md: Allow metadata_version to be updated for externally managed metadata.
commit ea43ddd8491feccf36267349748ea91b1194481e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a0401bd9184b..60f3e59b61f7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2960,7 +2960,13 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len)
{
int major, minor;
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;
if (cmd_match(buf, "none")) {