dedupe: exit gracefully if device/file open fails
authorJens Axboe <axboe@fb.com>
Sat, 27 Sep 2014 14:08:24 +0000 (08:08 -0600)
committerJens Axboe <axboe@fb.com>
Sat, 27 Sep 2014 14:08:24 +0000 (08:08 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
t/dedupe.c

index 5998138b507435e580b5305eaa5e41025d6a727f..fc280772cb9bf139a9c70a6b521e667e2dafae9d 100644 (file)
@@ -575,10 +575,12 @@ int main(int argc, char *argv[])
 
        ret = dedupe_check(argv[optind], &nextents, &nchunks);
 
-       if (!bloom)
-               iter_rb_tree(&nextents, &nchunks);
+       if (!ret) {
+               if (!bloom)
+                       iter_rb_tree(&nextents, &nchunks);
 
-       show_stat(nextents, nchunks);
+               show_stat(nextents, nchunks);
+       }
 
        fio_mutex_remove(rb_lock);
        if (bloom)