if (test_bit(BCH_FS_INITIAL_GC_UNFIXED, &c->flags)) {
bch_err(c, "cannot go rw, unfixed btree errors");
- return -EROFS;
+ return -BCH_ERR_erofs_unfixed_errors;
}
if (test_bit(BCH_FS_RW, &c->flags))
return 0;
+ if (c->opts.norecovery)
+ return -BCH_ERR_erofs_norecovery;
+
/*
* nochanges is used for fsck -n mode - we have to allow going rw
* during recovery for that to work:
*/
- if (c->opts.norecovery ||
- (c->opts.nochanges &&
- (!early || c->opts.read_only)))
- return -EROFS;
+ if (c->opts.nochanges && (!early || c->opts.read_only))
+ return -BCH_ERR_erofs_nochanges;
bch_info(c, "going read-write");
unsigned i, iter_size;
int ret = 0;
- pr_verbose_init(opts, "");
-
c = kvpmalloc(sizeof(struct bch_fs), GFP_KERNEL|__GFP_ZERO);
if (!c) {
c = ERR_PTR(-BCH_ERR_ENOMEM_fs_alloc);
if (ret)
goto err;
out:
- pr_verbose_init(opts, "ret %i", PTR_ERR_OR_ZERO(c));
return c;
err:
bch2_fs_free(c);
struct bch_dev *ca = NULL;
int ret = 0;
- pr_verbose_init(c->opts, "");
-
if (bch2_fs_init_fault("dev_alloc"))
goto err;
ca->fs = c;
bch2_dev_attach(c, ca, dev_idx);
-out:
- pr_verbose_init(c->opts, "ret %i", ret);
return ret;
err:
if (ca)
bch2_dev_free(ca);
- ret = -BCH_ERR_ENOMEM_dev_alloc;
- goto out;
+ return -BCH_ERR_ENOMEM_dev_alloc;
}
static int __bch2_dev_attach_bdev(struct bch_dev *ca, struct bch_sb_handle *sb)
if (!try_module_get(THIS_MODULE))
return ERR_PTR(-ENODEV);
- pr_verbose_init(opts, "");
-
if (!nr_devices) {
ret = -EINVAL;
goto err;
kfree(sb);
printbuf_exit(&errbuf);
module_put(THIS_MODULE);
- pr_verbose_init(opts, "ret %s (%i)", bch2_err_str(PTR_ERR_OR_ZERO(c)),
- PTR_ERR_OR_ZERO(c));
return c;
err_print:
pr_err("bch_fs_open err opening %s: %s",