diff options
author | Luca Berra <bluca@comedia.it> | 2006-10-16 07:27:16 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-10-16 07:27:16 +0200 |
commit | e60c27d04e20944cbfd521d6ca72ab8eb8ab484d (patch) | |
tree | ff79d5122688ffed793e9b7a188cedc004ea9b2c /mdopen.c | |
parent | Mdassemble improvements (diff) | |
download | mdadm-e60c27d04e20944cbfd521d6ca72ab8eb8ab484d.tar.xz mdadm-e60c27d04e20944cbfd521d6ca72ab8eb8ab484d.zip |
Don't fail md_open if array already active.
From: Luca Berra <bluca@comedia.it>
There is no need and it causes occasional problems.
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -171,7 +171,6 @@ int open_mddev(char *dev, int autof) if (stb.st_mode && major(stb.st_rdev) != major) must_remove = 1; if (stb.st_mode && !must_remove) { - mdu_array_info_t array; /* looks ok, see if it is available */ mdfd = open(dev, O_RDWR, 0); if (mdfd < 0) { @@ -184,17 +183,9 @@ int open_mddev(char *dev, int autof) close(mdfd); return -1; } - if (ioctl(mdfd, GET_ARRAY_INFO, &array)==0) { - /* already active */ - close(mdfd); - fprintf(stderr, Name ": %s is already active.\n", - dev); - return -1; - } else { - if (major != MD_MAJOR && parts > 0) - make_parts(dev, parts, ci->symlinks); - return mdfd; - } + if (major != MD_MAJOR && parts > 0) + make_parts(dev, parts, ci->symlinks); + return mdfd; } /* Ok, need to find a minor that is not in use. * If the device name is in a 'standard' format, |