blkrawverify is prints no errors and returns success if the
requested tracefiles aren't found:
# blkrawverify foobar
Verifying foobar
# echo $?
0
With this change it's a bit more informative:
# ./blkrawverify foobar
Verifying foobar
No tracefiles found for foobar
# echo $?
1
Resolves Red Hat Bugzilla #499581
Reported-by: Milos Malik <mmalik@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
printf("Verifying %s\n", devname); fflush(stdout);
for (cpu = 0; ; cpu++) {
sprintf(fname, "%s.blktrace.%d", devname, cpu);
- if (stat(fname, &st) < 0)
+ if (stat(fname, &st) < 0) {
+ if (cpu == 0) {
+ fprintf(stderr, "No tracefiles found for %s\n",
+ devname);
+ rval = 1;
+ }
break;
+ }
printf(" CPU %d ", cpu); fflush(stdout);
nbad = process(&ofp, devname, fname, cpu);
if (nbad) {