From: Su Yue <l@damenly.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Hongbo Li <lihongbo22@huawei.com>,
kent.overstreet@linux.dev, bfoster@redhat.com,
linux-bcachefs@vger.kernel.org
Subject: Re: [PATCH] bcachefs: avoid returning private error code in bch2_xattr_bcachefs_set
Date: Fri, 01 Mar 2024 13:45:23 +0800 [thread overview]
Message-ID: <wmqmmrmd.fsf@damenly.org> (raw)
In-Reply-To: <27c97dbd-cbc1-f6d3-9114-3eaf27d86c48@huawei.com>
On Fri 01 Mar 2024 at 11:26, Jinjie Ruan <ruanjinjie@huawei.com>
wrote:
> On 2024/3/1 11:17, Hongbo Li wrote:
>> Avoid the private error code return to caller. The error code
>> should be transformed into genernal error code.
>>
>> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
>> ---
>> fs/bcachefs/xattr.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c
>> index 9c0d2316031b..754f17bba68e 100644
>> --- a/fs/bcachefs/xattr.c
>> +++ b/fs/bcachefs/xattr.c
>> @@ -544,11 +544,11 @@ static int bch2_xattr_bcachefs_set(const
>> struct xattr_handler *handler,
>> kfree(buf);
>>
>> if (ret < 0)
>> - return ret;
>> + goto err_class_exit;
>>
>> ret = bch2_opt_check_may_set(c, opt_id, v);
>> if (ret < 0)
>> - return ret;
>> + goto err_class_exit;
>>
>> s.v = v + 1;
>> s.defined = true;
>> @@ -595,6 +595,7 @@ static int bch2_xattr_bcachefs_set(const
>> struct xattr_handler *handler,
>> (opt_id == Opt_compression && !inode_opt_get(c,
>> &inode->ei_inode, background_compression))))
>> bch2_set_rebalance_needs_scan(c,
>> inode->ei_inode.bi_inum);
>>
>> +err_class_exit:
>> return bch2_err_class(ret);
>
> 那前面的return -ENOMEM和return -EINVAL不用转换吗
>
Please reply in english. Thanks.
--
Su
>> }
>>
prev parent reply other threads:[~2024-03-01 5:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 3:17 [PATCH] bcachefs: avoid returning private error code in bch2_xattr_bcachefs_set Hongbo Li
2024-03-01 3:26 ` Jinjie Ruan
2024-03-01 3:29 ` Kent Overstreet
2024-03-01 3:41 ` Hongbo Li
2024-03-01 3:53 ` Kent Overstreet
2024-03-01 5:45 ` Su Yue [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wmqmmrmd.fsf@damenly.org \
--to=l@damenly.org \
--cc=bfoster@redhat.com \
--cc=kent.overstreet@linux.dev \
--cc=lihongbo22@huawei.com \
--cc=linux-bcachefs@vger.kernel.org \
--cc=ruanjinjie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.