From patchwork Thu Feb 2 12:33:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiyang Ruan X-Patchwork-Id: 13125886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F050C61DA4 for ; Thu, 2 Feb 2023 12:34:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbjBBMeH (ORCPT ); Thu, 2 Feb 2023 07:34:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjBBMeG (ORCPT ); Thu, 2 Feb 2023 07:34:06 -0500 Received: from mail3.bemta32.messagelabs.com (mail3.bemta32.messagelabs.com [195.245.230.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 968F77374D for ; Thu, 2 Feb 2023 04:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1675341242; i=@fujitsu.com; bh=J3fIpU6tmL9uRL1TDcHv8hQsLLABkSDshjR6iG+9dYE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=uq7i8CiknZ2pQOuw3T5396v2GMu6RqwSI6rgSWbW4XxVtM4rNxmzRjxtifoMMvtmk DinT2MZ2ozgnTeYN2s4N0mbEnLFDH+1SGPLcqGOMU746WA/JGWrIj2nNJ9urn2JK7O gxymilg5FrtheVwUF/wICmLfEHT4jGQwMe3hJZDrk4CfjadO6iGWMNkJ9daSE26m3Y DPofCpXzyjpHhu8vmewBrjhe9g6QI5xOXQOlkc/qheXY6Cml7jSv7lXfRWz8OVpFNk vX6113L3Lkl55MWqJ5s8rcctTd26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v1Pn537e0JGZGnXbtftKz3KTyVdCyzf0qEyx33vSSWW4oxEQy3mouJEAOzZz eB1AwAA X-Env-Sender: ruansy.fnst@fujitsu.com X-Msg-Ref: server-22.tower-585.messagelabs.com!1675341241!62076!1 X-Originating-IP: [62.60.8.98] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.102.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15427 invoked from network); 2 Feb 2023 12:34:02 -0000 Received: from unknown (HELO n03ukasimr03.n03.fujitsu.local) (62.60.8.98) by server-22.tower-585.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Feb 2023 12:34:02 -0000 Received: from n03ukasimr03.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr03.n03.fujitsu.local (Postfix) with ESMTP id A02B71AE; Thu, 2 Feb 2023 12:34:01 +0000 (GMT) Received: from R01UKEXCASM223.r01.fujitsu.local (R01UKEXCASM223 [10.182.185.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr03.n03.fujitsu.local (Postfix) with ESMTPS id 8F6551AC; Thu, 2 Feb 2023 12:34:01 +0000 (GMT) Received: from localhost.localdomain (10.167.225.141) by R01UKEXCASM223.r01.fujitsu.local (10.182.185.121) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 2 Feb 2023 12:33:58 +0000 From: Shiyang Ruan To: , , CC: , , , , Subject: [PATCH] fsdax: dax_unshare_iter() should return a valid length Date: Thu, 2 Feb 2023 12:33:47 +0000 Message-ID: <1675341227-14-1-git-send-email-ruansy.fnst@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.225.141] X-ClientProxiedBy: G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) To R01UKEXCASM223.r01.fujitsu.local (10.182.185.121) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The copy_mc_to_kernel() will return 0 if it executed successfully. Then the return value should be set to the length it copied. Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan --- fs/dax.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dax.c b/fs/dax.c index c48a3a93ab29..a5b4deb5def3 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1274,6 +1274,7 @@ static s64 dax_unshare_iter(struct iomap_iter *iter) ret = copy_mc_to_kernel(daddr, saddr, length); if (ret) ret = -EIO; + ret = length; out_unlock: dax_read_unlock(id);