diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-18 17:10:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:40 -0400 |
commit | 098ef98d5bff461c66c3798fbebca7b1c06fdf79 (patch) | |
tree | 02879fcbd6d74a5a05a46ad399a73dac4aafd33b /fs/bcachefs/alloc_foreground.c | |
parent | 5c1ef830f6786059f85bebe7501b63dffed0b633 (diff) |
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/alloc_foreground.c')
-rw-r--r-- | fs/bcachefs/alloc_foreground.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index f60fe159916e..e890b09f80c6 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -1246,7 +1246,9 @@ err: if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty) || bch2_err_matches(ret, BCH_ERR_freelist_empty)) - return cl ? -EAGAIN : -ENOSPC; + return cl + ? -EAGAIN + : -BCH_ERR_ENOSPC_bucket_alloc; if (bch2_err_matches(ret, BCH_ERR_insufficient_devices)) return -EROFS; |