summaryrefslogtreecommitdiff
path: root/fs/bcachefs/xattr.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/xattr.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/xattr.c')
-rw-r--r--fs/bcachefs/xattr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c
index bd118f6ea08b..448737be045c 100644
--- a/fs/bcachefs/xattr.c
+++ b/fs/bcachefs/xattr.c
@@ -78,7 +78,7 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
if (bkey_val_bytes(k.k) < sizeof(struct bch_xattr)) {
prt_printf(err, "incorrect value size (%zu < %zu)",
bkey_val_bytes(k.k), sizeof(*xattr.v));
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (bkey_val_u64s(k.k) <
@@ -88,7 +88,7 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
bkey_val_u64s(k.k),
xattr_val_u64s(xattr.v->x_name_len,
le16_to_cpu(xattr.v->x_val_len)));
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
/* XXX why +4 ? */
@@ -99,18 +99,18 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
bkey_val_u64s(k.k),
xattr_val_u64s(xattr.v->x_name_len,
le16_to_cpu(xattr.v->x_val_len) + 4));
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
handler = bch2_xattr_type_to_handler(xattr.v->x_type);
if (!handler) {
prt_printf(err, "invalid type (%u)", xattr.v->x_type);
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (memchr(xattr.v->x_name, '\0', xattr.v->x_name_len)) {
prt_printf(err, "xattr name has invalid characters");
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
return 0;