diff options
author | Neil Brown <neilb@suse.de> | 2008-07-12 20:28:38 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-07-12 20:28:38 +1000 |
commit | 2c514b7120a5e58cf803c854c047de03bd774730 (patch) | |
tree | a7c97aeb88519ebf9520285c83e80b1d482cdcaf /super1.c | |
parent | 047d2e49f52a25cc88781d11cd83e147791975d6 (diff) | |
download | mdadm-2c514b7120a5e58cf803c854c047de03bd774730.tar.gz |
Pass 'verbose' flag to validate_geometry
That way it can be silent when we are just trying to figure out
which metadata to use, and noisy when detecting a real problem.
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; |