summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorMariusz Dabrowski <mariusz.dabrowski@intel.com>2019-07-10 13:38:53 +0200
committerJes Sorensen <jsorensen@fb.com>2019-07-10 22:12:09 +0200
commitb06815989179e0f153e44e4336290e655edce9a1 (patch)
treedd3b3b2de676d8de7c0ce322300441de4f972f0a /Assemble.c
parentsuper-intel: Use put_unaligned in split_ull (diff)
downloadmdadm-b06815989179e0f153e44e4336290e655edce9a1.tar.xz
mdadm-b06815989179e0f153e44e4336290e655edce9a1.zip
mdadm: load default sysfs attributes after assemblation
Added new type of line to mdadm.conf which allows to specify values of sysfs attributes for MD devices that should be loaded after the array is assembled. Each line is interpreted as list of structures containing sysname of MD device (md126 etc.) and list of sysfs attributes and their values. Signed-off-by: Mariusz Dabrowski <mariusz.dabrowski@intel.com> Signed-off-by: Krzysztof Smolinski <krzysztof.smolinski@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Assemble.c b/Assemble.c
index 420c7b39..b2e69144 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1063,9 +1063,12 @@ static int start_array(int mdfd,
mddev, okcnt + sparecnt + journalcnt,
okcnt + sparecnt + journalcnt == 1 ? "" : "s");
if (okcnt < (unsigned)content->array.raid_disks)
- fprintf(stderr, " (out of %d)",
+ fprintf(stderr, " (out of %d)\n",
content->array.raid_disks);
- fprintf(stderr, "\n");
+ else {
+ fprintf(stderr, "\n");
+ sysfs_rules_apply(mddev, content);
+ }
}
if (st->ss->validate_container) {
@@ -1139,6 +1142,7 @@ static int start_array(int mdfd,
rv = ioctl(mdfd, RUN_ARRAY, NULL);
reopen_mddev(mdfd); /* drop O_EXCL */
if (rv == 0) {
+ sysfs_rules_apply(mddev, content);
if (c->verbose >= 0) {
pr_err("%s has been started with %d drive%s",
mddev, okcnt, okcnt==1?"":"s");
@@ -2130,10 +2134,12 @@ int assemble_container_content(struct supertype *st, int mdfd,
pr_err("array %s now has %d device%s",
chosen_name, working + preexist,
working + preexist == 1 ? "":"s");
- else
+ else {
+ sysfs_rules_apply(chosen_name, content);
pr_err("Started %s with %d device%s",
chosen_name, working + preexist,
working + preexist == 1 ? "":"s");
+ }
if (preexist)
fprintf(stderr, " (%d new)", working);
if (expansion)