diff options
author | NeilBrown <neilb@suse.de> | 2013-12-05 00:35:16 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-12-05 00:35:16 +0100 |
commit | 8832342d3aad09d3c86af6dc9b137d6fd83af1ae (patch) | |
tree | 7a5c843a1a1f3de1d546abea41cd9cc3d4074391 /Incremental.c | |
parent | Two small fixes related to enough() (diff) | |
download | mdadm-8832342d3aad09d3c86af6dc9b137d6fd83af1ae.tar.xz mdadm-8832342d3aad09d3c86af6dc9b137d6fd83af1ae.zip |
Assemble/Incremental: don't hold O_EXCL on mddev after assembly.
As soon as the array is assembled, udev or systemd might run
fsck and mount it. So we need to drop O_EXCL promptly.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Incremental.c b/Incremental.c index f548bad9..c9372587 100644 --- a/Incremental.c +++ b/Incremental.c @@ -588,10 +588,14 @@ int Incremental(struct mddev_dev *devlist, struct context *c, else rv = sysfs_set_str(sra, NULL, "array_state", "read-auto"); + /* Array might be O_EXCL which will interfere with + * fsck and mount. So re-open without O_EXCL. + */ + reopen_mddev(mdfd); if (rv == 0) { - if (c->export) { - printf("MD_STARTED=yes\n"); - } else if (c->verbose >= 0) + if (c->export) { + printf("MD_STARTED=yes\n"); + } else if (c->verbose >= 0) pr_err("%s attached to %s, which has been started.\n", devname, chosen_name); rv = 0; |