]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdopen.c
util: Introduce md_get_disk_info()
[thirdparty/mdadm.git] / mdopen.c
index 0ea38749a58226f9766a36621ef1e4ae521082d2..685ca3287304fc3b4f9ff22488cd717895dc4c21 100644 (file)
--- a/mdopen.c
+++ b/mdopen.c
@@ -416,9 +416,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
  */
 int open_mddev(char *dev, int report_errors)
 {
-       int mdfd = open(dev, O_RDWR);
-       if (mdfd < 0 && errno == EACCES)
-               mdfd = open(dev, O_RDONLY);
+       int mdfd = open(dev, O_RDONLY);
        if (mdfd < 0) {
                if (report_errors)
                        pr_err("error opening %s: %s\n",