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 5998138..fc28077 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)