Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp952831pxp; Wed, 16 Mar 2022 22:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoPJdkHCyVvrpLo6t2NSb06h3iAQfk/AevHAHf1BPqJFnbYo3WFyye5nh04WRuJWaCS12m X-Received: by 2002:a63:5a41:0:b0:382:1b0:3446 with SMTP id k1-20020a635a41000000b0038201b03446mr2077742pgm.73.1647494888812; Wed, 16 Mar 2022 22:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647494888; cv=none; d=google.com; s=arc-20160816; b=w3v9IaJaniual+jPiVcPe0MoViootuUo6aKh4oRlBSuzw4oxYZiIJYCGK/QjShnhA8 MHjzxsq2a8eXwACtogr5auuPCnUIPG3z5IjqzgFaPk/y1OtoONMPHsiLaVg9l3OzKCea 8DBjCvt57Zq1GPZJZS6mkx/Szr8dR0KRrhwJzDkltevMkSeOSKk+wsBiIeSURD4KSB6A 4Du7vtdcLcM47U0Fk/S03h9Yk6sBAbXfYvIdJsvrgr+VDm4Wu23JFe0xDsCqKEUXueP2 3rHcK6m1CgfE6PMIpRnFNlxoIP2F2Zf00QjgJb17F+1RIu8VJZPTx6haucZ8Xb3DW58a +Dkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5vHYgj+mHVYCSpu++Usp7k2s2ZvhU86yFH9yW6PA/nU=; b=g0H1oLeDfZ/3gvtCsp5e9+k5L1I2A9LcOzq4DlcASrL/ZIqCpoYaNLIDznH730et1l o11EQsbyH0RsR5JaSOfP6W/0Sh1zCf3JkOXwzNIP4eMrSrxbHW/JQ2jFIf9M/cSYPuU/ lC5v99vLs5nYGJurQ2wKg9tnxcITq6cNCQsh3YwEFO5bBHxEm2//QSXn8pyoHqmMdQK1 CmE7/YKXftL+6NRT4OOV0wxlXYvhVUaQ26iXnBRvnNK7FmAEFBdGDGhE6hictrX7ylpF VlezWJDVibYxKk3OwtGu+6c1YxQRb5oqn4u3vIqdybpN9fOTZSKZWRo9hHFaCgpqvXUW k0vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x11-20020a170902820b00b00153158a024dsi3327362pln.168.2022.03.16.22.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B5960223218; Wed, 16 Mar 2022 21:29:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348061AbiCQBlA (ORCPT + 99 others); Wed, 16 Mar 2022 21:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235641AbiCQBk7 (ORCPT ); Wed, 16 Mar 2022 21:40:59 -0400 Received: from out199-1.us.a.mail.aliyun.com (out199-1.us.a.mail.aliyun.com [47.90.199.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1ECB647B; Wed, 16 Mar 2022 18:39:43 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V7Oibyl_1647481173; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0V7Oibyl_1647481173) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Mar 2022 09:39:40 +0800 From: Jiapeng Chong To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] xfs: Fix missing error code in xfs_reflink_end_cow_extent() Date: Thu, 17 Mar 2022 09:39:30 +0800 Message-Id: <20220317013930.124432-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Jiapeng Chong --- 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