diff options
author | NeilBrown <neilb@suse.com> | 2017-04-28 07:05:50 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-05-02 15:41:39 +0200 |
commit | cd6cbb08c458cee07acb1d854e04532b29ec87bf (patch) | |
tree | ca6482225586ea4d423af1e674dd5ca7021daa4a /Build.c | |
parent | Incremental: Cleanup some if() statement spaghetti (diff) | |
download | mdadm-cd6cbb08c458cee07acb1d854e04532b29ec87bf.tar.xz mdadm-cd6cbb08c458cee07acb1d854e04532b29ec87bf.zip |
Create: tell udev md device is not ready when first created.
When an array is created the content is not initialized,
so it could have remnants of an old filesystem or md array
etc on it.
udev will see this and might try to activate it, which is almost
certainly not what is wanted.
So create a mechanism for mdadm to communicate with udev to tell
it that the device isn't ready. This mechanism is the existance
of a file /run/mdadm/created-mdXXX where mdXXX is the md device name.
When creating an array, mdadm will create the file.
A new udev rule file, 01-md-raid-creating.rules, will detect the
precense of thst file and set ENV{SYSTEMD_READY}="0".
This is fairly uniformly used to suppress actions based on the
contents of the device.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Build.c')
-rw-r--r-- | Build.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -109,7 +109,7 @@ int Build(char *mddev, struct mddev_dev *devlist, /* We need to create the device. It can have no name. */ map_lock(&map); mdfd = create_mddev(mddev, NULL, c->autof, LOCAL, - chosen_name); + chosen_name, 0); if (mdfd < 0) { map_unlock(&map); return 1; |