diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-19 00:10:33 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:40 +0300 |
commit | 098ef98d5bff461c66c3798fbebca7b1c06fdf79 (patch) | |
tree | 02879fcbd6d74a5a05a46ad399a73dac4aafd33b /fs/bcachefs/super.c | |
parent | 5c1ef830f6786059f85bebe7501b63dffed0b633 (diff) | |
download | linux-098ef98d5bff461c66c3798fbebca7b1c06fdf79.tar.xz |
bcachefs: Add private error codes for ENOSPC
Continuing the saga of introducing private dedicated error codes for
each error path, this patch converts ENOSPC to error codes that are
subtypes of ENOSPC. We've recently had a test failure where we got
-ENOSPC where we shouldn't have, and didn't have enough information to
tell where it came from, so this patch will solve that problem.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 1c8fac603644..8dc87c103216 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1584,7 +1584,7 @@ int bch2_dev_add(struct bch_fs *c, const char *path) le32_to_cpu(mi->field.u64s) + sizeof(dev_mi) / sizeof(u64))) { bch_err(c, "device add error: new device superblock too small"); - ret = -ENOSPC; + ret = -BCH_ERR_ENOSPC_sb_members; goto err_unlock; } @@ -1597,7 +1597,7 @@ int bch2_dev_add(struct bch_fs *c, const char *path) goto have_slot; no_slot: bch_err(c, "device add error: already have maximum number of devices"); - ret = -ENOSPC; + ret = -BCH_ERR_ENOSPC_sb_members; goto err_unlock; have_slot: @@ -1608,7 +1608,7 @@ have_slot: mi = bch2_sb_resize_members(&c->disk_sb, u64s); if (!mi) { bch_err(c, "device add error: no room in superblock for member info"); - ret = -ENOSPC; + ret = -BCH_ERR_ENOSPC_sb_members; goto err_unlock; } |