- err = bch2_fs_open(argv + optind, argc - optind, opts, &c);
- if (err)
- die("error opening %s: %s", argv[optind], err);
+ struct bch_fs *c = bch2_fs_open(argv, argc, opts);
+ if (IS_ERR(c))
+ die("error opening %s: %s", argv[0], strerror(-PTR_ERR(c)));
+
+ if (test_bit(BCH_FS_FSCK_FIXED_ERRORS, &c->flags))
+ ret = 2;
+ if (test_bit(BCH_FS_FSCK_UNFIXED_ERRORS, &c->flags))
+ ret = 4;