Skip to content

Commit 7e23c17

Browse files
Hongbo LiKent Overstreet
authored andcommitted
bcachefs: avoid returning private error code in bch2_xattr_bcachefs_set
Avoid the private error code return to caller. The error code should be transformed into genernal error code. Signed-off-by: Hongbo Li <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 7e64c86 commit 7e23c17

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/bcachefs/xattr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,11 @@ static int bch2_xattr_bcachefs_set(const struct xattr_handler *handler,
544544
kfree(buf);
545545

546546
if (ret < 0)
547-
return ret;
547+
goto err_class_exit;
548548

549549
ret = bch2_opt_check_may_set(c, opt_id, v);
550550
if (ret < 0)
551-
return ret;
551+
goto err_class_exit;
552552

553553
s.v = v + 1;
554554
s.defined = true;
@@ -595,6 +595,7 @@ static int bch2_xattr_bcachefs_set(const struct xattr_handler *handler,
595595
(opt_id == Opt_compression && !inode_opt_get(c, &inode->ei_inode, background_compression))))
596596
bch2_set_rebalance_needs_scan(c, inode->ei_inode.bi_inum);
597597

598+
err_class_exit:
598599
return bch2_err_class(ret);
599600
}
600601

0 commit comments

Comments
 (0)