/* from mdopen.c */
int open_mddev(char *dev, int report_errors/*unused*/)
{
- int mdfd = open(dev, O_RDWR);
+ int mdfd = open(dev, O_RDONLY);
if (mdfd < 0)
pr_err("error opening %s: %s\n",
dev, strerror(errno));
if (strcasecmp(array_list->devname, "<ignore>") == 0)
continue;
mdfd = open_mddev(array_list->devname, 0);
- if (mdfd >= 0 && ioctl(mdfd, GET_ARRAY_INFO, &array) == 0) {
+ if (mdfd >= 0 && md_get_array_info(mdfd, &array) == 0) {
rv |= Manage_ro(array_list->devname, mdfd, -1); /* make it readwrite */
continue;
}