A recent change to improve error messages make it not possible to
create an array from devices that are 'busy'. However if they are
made busy by a container, then the create should be allowed.
So move one of the error messages later.
Reported-by: "Wojcik, Krzysztof" <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
missing_disks ++;
continue;
}
- dfd = open(dname, O_RDONLY|O_EXCL);
+ dfd = open(dname, O_RDONLY);
if (dfd < 0) {
fprintf(stderr, Name ": cannot open %s: %s\n",
dname, strerror(errno));
}
if (!st) {
+ int dfd = open(dname, O_RDONLY|O_EXCL);
+ if (dfd < 0) {
+ fprintf(stderr, Name ": cannot open %s: %s\n",
+ dname, strerror(errno));
+ exit(2);
+ }
fprintf(stderr, Name ": device %s not suitable "
"for any style of array\n",
dname);