lkml.org 
[lkml]   [2022]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] xfs: Fix missing error code in xfs_reflink_end_cow_extent()
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
>

\
 
 \ /
  Last update: 2022-03-17 03:42    [W:0.046 / U:1.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site