]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Correct readlink usage in sysfs.c
[thirdparty/mdadm.git] / super1.c
index 507e418ceebd73955a2a2a44baf586415631abfd..06d0a1876cf1f678f27661c14dfc8649576d8c89 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1465,7 +1465,8 @@ static void free_super1(struct supertype *st)
 static int validate_geometry1(struct supertype *st, int level,
                              int layout, int raiddisks,
                              int chunk, unsigned long long size,
-                             char *subdev, unsigned long long *freesize)
+                             char *subdev, unsigned long long *freesize,
+                             int verbose)
 {
        unsigned long long ldsize;
        int fd;
@@ -1477,10 +1478,12 @@ static int validate_geometry1(struct supertype *st, int level,
 
        fd = open(subdev, O_RDONLY|O_EXCL, 0);
        if (fd < 0) {
-               fprintf(stderr, Name ": Cannot open %s: %s\n",
-                       subdev, strerror(errno));
+               if (verbose)
+                       fprintf(stderr, Name ": super1.x cannot open %s: %s\n",
+                               subdev, strerror(errno));
                return 0;
        }
+
        if (!get_dev_size(fd, subdev, &ldsize)) {
                close(fd);
                return 0;