summaryrefslogtreecommitdiff
path: root/c_src
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-08-20 19:47:56 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-08-20 19:47:56 -0400
commit31039815a763d9b051eae0a195438733c48411e9 (patch)
tree6483c24fe51f374f2a895b6142469f88baccb969 /c_src
parent8e0023ed4acdb3c736d77d775a790394a9701632 (diff)
posix_to_bcachefs: fix missing copy_xattrs() error checking
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src')
-rw-r--r--c_src/posix_to_bcachefs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c
index 81750751..19c53cc3 100644
--- a/c_src/posix_to_bcachefs.c
+++ b/c_src/posix_to_bcachefs.c
@@ -122,12 +122,13 @@ void copy_xattrs(struct bch_fs *c, struct bch_inode_unpacked *dst,
die("error getting xattr val: %m");
const struct xattr_handler *h = xattr_resolve_name(&attr);
- struct bch_inode_unpacked inode_u;
+ if (IS_ERR(h))
+ continue;
int ret = bch2_trans_do(c, NULL, NULL, 0,
bch2_xattr_set(trans,
(subvol_inum) { 1, dst->bi_inum },
- &inode_u, &hash_info, attr,
+ dst, &hash_info, attr,
val, val_size, h->flags, 0));
if (ret < 0)
die("error creating xattr: %s", bch2_err_str(ret));