From: "Darrick J. Wong" <djwong@kernel.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] xfs: Fix missing error code in xfs_reflink_end_cow_extent()
Date: Wed, 16 Mar 2022 19:39:14 -0700 [thread overview]
Message-ID: <20220317023914.GX8224@magnolia> (raw)
In-Reply-To: <20220317013930.124432-1-jiapeng.chong@linux.alibaba.com>
On Thu, Mar 17, 2022 at 09:39:30AM +0800, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'error'.
>
> Eliminate the follow smatch warning:
>
> fs/xfs/xfs_reflink.c:634 xfs_reflink_end_cow_extent() warn: missing
> error code 'error'.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> fs/xfs/xfs_reflink.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index 54e68e5693fd..7265f8850f65 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -631,6 +631,7 @@ xfs_reflink_end_cow_extent(
> if (!xfs_iext_lookup_extent_before(ip, ifp, end_fsb, &icur, &got) ||
> got.br_startoff + got.br_blockcount <= offset_fsb) {
> *end_fsb = offset_fsb;
> + error = -EINVAL;
Why would we return EINVAL for the case where there's no work left to
do?
--D
> goto out_cancel;
> }
>
> --
> 2.20.1.7.g153144c
>
next prev parent reply other threads:[~2022-03-17 2:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 1:39 Jiapeng Chong
2022-03-17 2:39 ` Darrick J. Wong [this message]
2022-03-20 15:39 ` [xfs] f04c30c1aa: xfstests.xfs.239.fail kernel test robot
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=20220317023914.GX8224@magnolia \
--to=djwong@kernel.org \
--cc=abaci@linux.alibaba.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®