summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-08 00:09:26 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:06 +0300
commit7c50140fce00120b1dcf674759393267689ca2d8 (patch)
tree7aa467e2320738803ec073de2566810f7ad95ca9 /fs/bcachefs/super.c
parentc8b4534d820f47480e7d5efb38d13e10919ccc7c (diff)
downloadlinux-7c50140fce00120b1dcf674759393267689ca2d8.tar.xz
bcachefs: Convert more -EROFS to private error codes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 06d461423da5..6ab98c2299dd 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -361,20 +361,21 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early)
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");