diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-20 04:39:08 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:48 +0200 |
commit | 78c0b75c34209c471616566b3978eac4c1c53e99 (patch) | |
tree | e5c64b4d5d643e6170f2acfff1f279333235b398 /fs/bcachefs/replicas.c | |
parent | bcachefs: Suppress -EROFS messages when shutting down (diff) | |
download | linux-78c0b75c34209c471616566b3978eac4c1c53e99.tar.xz linux-78c0b75c34209c471616566b3978eac4c1c53e99.zip |
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.c | 10 |
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; } } } |