mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: Fix missing error code in xfs_reflink_end_cow_extent()
@ 2022-03-17  1:39 Jiapeng Chong
  2022-03-17  2:39 ` Darrick J. Wong
  2022-03-20 15:39 ` [xfs] f04c30c1aa: xfstests.xfs.239.fail kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2022-03-17  1:39 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, linux-kernel, Jiapeng Chong, Abaci Robot

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;
 		goto out_cancel;
 	}
 
-- 
2.20.1.7.g153144c


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-20 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17  1:39 [PATCH] xfs: Fix missing error code in xfs_reflink_end_cow_extent() Jiapeng Chong
2022-03-17  2:39 ` Darrick J. Wong
2022-03-20 15:39 ` [xfs] f04c30c1aa: xfstests.xfs.239.fail kernel test robot

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®