diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-24 01:26:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-24 01:26:40 -0500 |
commit | 03272a1e5559ce508400862285b8a3f05c500955 (patch) | |
tree | 64518b8cae701eb751fcf341da5e7178a49b3021 /libbcachefs/errcode.c | |
parent | 010182e79051fccbedc35aaa55dc67266ae3b3d0 (diff) |
Update bcachefs sources to a623b3063d5d bcachefs: Fix check_snapshot() memcpy
Diffstat (limited to 'libbcachefs/errcode.c')
-rw-r--r-- | libbcachefs/errcode.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libbcachefs/errcode.c b/libbcachefs/errcode.c index d260ff9b..43557beb 100644 --- a/libbcachefs/errcode.c +++ b/libbcachefs/errcode.c @@ -2,6 +2,7 @@ #include "bcachefs.h" #include "errcode.h" +#include "trace.h" #include <linux/errname.h> @@ -49,15 +50,17 @@ bool __bch2_err_matches(int err, int class) return err == class; } -int __bch2_err_class(int err) +int __bch2_err_class(int bch_err) { - err = -err; - BUG_ON((unsigned) err >= BCH_ERR_MAX); + int std_err = -bch_err; + BUG_ON((unsigned) std_err >= BCH_ERR_MAX); - while (err >= BCH_ERR_START && bch2_errcode_parents[err - BCH_ERR_START]) - err = bch2_errcode_parents[err - BCH_ERR_START]; + while (std_err >= BCH_ERR_START && bch2_errcode_parents[std_err - BCH_ERR_START]) + std_err = bch2_errcode_parents[std_err - BCH_ERR_START]; + + trace_error_downcast(bch_err, std_err, _RET_IP_); - return -err; + return -std_err; } const char *bch2_blk_status_to_str(blk_status_t status) |