summaryrefslogtreecommitdiff
path: root/fs/bcachefs/replicas.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-20 06:39:08 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:48 +0300
commit78c0b75c34209c471616566b3978eac4c1c53e99 (patch)
treee5c64b4d5d643e6170f2acfff1f279333235b398 /fs/bcachefs/replicas.c
parent5f659376fc1b9ad23b00a35242179b8961e0bc2d (diff)
downloadlinux-78c0b75c34209c471616566b3978eac4c1c53e99.tar.xz
bcachefs: More errcode cleanup
We shouldn't be overloading standard error codes now that we have provisions for bcachefs-specific errorcodes: this patch converts super.c and super-io.c to per error site errcodes, with a bit of cleanup. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/replicas.c')
-rw-r--r--fs/bcachefs/replicas.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/replicas.c b/fs/bcachefs/replicas.c
index e540c1aa91ba..482bedf4be8b 100644
--- a/fs/bcachefs/replicas.c
+++ b/fs/bcachefs/replicas.c
@@ -841,27 +841,27 @@ static int bch2_cpu_replicas_validate(struct bch_replicas_cpu *cpu_r,
if (e->data_type >= BCH_DATA_NR) {
prt_printf(err, "invalid data type in entry ");
bch2_replicas_entry_to_text(err, e);
- return -EINVAL;
+ return -BCH_ERR_invalid_sb_replicas;
}
if (!e->nr_devs) {
prt_printf(err, "no devices in entry ");
bch2_replicas_entry_to_text(err, e);
- return -EINVAL;
+ return -BCH_ERR_invalid_sb_replicas;
}
if (e->nr_required > 1 &&
e->nr_required >= e->nr_devs) {
prt_printf(err, "bad nr_required in entry ");
bch2_replicas_entry_to_text(err, e);
- return -EINVAL;
+ return -BCH_ERR_invalid_sb_replicas;
}
for (j = 0; j < e->nr_devs; j++)
if (!bch2_dev_exists(sb, mi, e->devs[j])) {
prt_printf(err, "invalid device %u in entry ", e->devs[j]);
bch2_replicas_entry_to_text(err, e);
- return -EINVAL;
+ return -BCH_ERR_invalid_sb_replicas;
}
if (i + 1 < cpu_r->nr) {
@@ -873,7 +873,7 @@ static int bch2_cpu_replicas_validate(struct bch_replicas_cpu *cpu_r,
if (!memcmp(e, n, cpu_r->entry_size)) {
prt_printf(err, "duplicate replicas entry ");
bch2_replicas_entry_to_text(err, e);
- return -EINVAL;
+ return -BCH_ERR_invalid_sb_replicas;
}
}
}