Message ID | 150486053591.31637.4198233649091096390.stgit@naota.dhcp.fujisawa.hgst.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-btrfs-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 599F16034B for <patchwork-linux-btrfs@patchwork.kernel.org>; Fri, 8 Sep 2017 08:49:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A5E02858B for <patchwork-linux-btrfs@patchwork.kernel.org>; Fri, 8 Sep 2017 08:49:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 377DA285AF; Fri, 8 Sep 2017 08:49:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 888142859F for <patchwork-linux-btrfs@patchwork.kernel.org>; Fri, 8 Sep 2017 08:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755698AbdIHItv (ORCPT <rfc822;patchwork-linux-btrfs@patchwork.kernel.org>); Fri, 8 Sep 2017 04:49:51 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:19605 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635AbdIHIts (ORCPT <rfc822; linux-btrfs@vger.kernel.org>); Fri, 8 Sep 2017 04:49:48 -0400 X-IronPort-AV: E=Sophos;i="5.42,360,1500912000"; d="scan'208";a="49099132" Received: from mail-by2nam03lp0048.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.48]) by ob1.hgst.iphmx.com with ESMTP; 08 Sep 2017 16:49:03 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/G16sJB8LU8FMSn71PaDvw/SYtCpzE8ALOtXnpEUuq8=; b=VKez40vavUYkEjAmDWBcS3tXpJixpXxA28XerWJdxdWxIsTJLxc7LINBeFREUAFPTZGVLhUW2pdapMkwjxKum82Z8JOku2PHvf3uhya7iAtxPApwdNwSHJ4Dg2QO4Ji6qu5RXPv7uw0ftapgkuZGAZ1Htc5U+OUPthyQQEqK2pA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Naohiro.Aota@wdc.com; Received: from naota.dhcp.fujisawa.hgst.com (199.255.44.171) by CY4PR04MB0665.namprd04.prod.outlook.com (10.172.136.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 8 Sep 2017 08:49:00 +0000 Subject: [PATCH] btrfs: propagate error to btrfs_cmp_data_prepare caller From: Naohiro Aota <naohiro.aota@wdc.com> To: linux-btrfs@vger.kernel.org Cc: mfasheh@suse.de, dsterba@suse.com Date: Fri, 08 Sep 2017 17:48:55 +0900 Message-ID: <150486053591.31637.4198233649091096390.stgit@naota.dhcp.fujisawa.hgst.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [199.255.44.171] X-ClientProxiedBy: MWHPR1201CA0002.namprd12.prod.outlook.com (10.174.253.12) To CY4PR04MB0665.namprd04.prod.outlook.com (10.172.136.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86beab80-8fce-4b29-d2aa-08d4f69673df X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR04MB0665; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0665; 3:+1XVUJQ+Jh7o4HloXkKv5WKjxQzA0CzPNchHkzx767EtcVKKMA6dDtuhWjRmBF8q8rQbpkCzCkJ8NtDG6N7nJF8T3aAL40TIwOTEbVz2AaSDsEv90DQ4YgDROk4Y3mSwYO+u7ZjMf1YeeTKq95K54MFyqu+7hWa9BC6RUeVlPxNvHCRLsLSBl7P86aZIhB4prczl0BV7kmhxxlm6ROdV63jXjWTdhli0gljGYmcQ1dnSKCcjFkFU+Qpz8o/yogYy; 25:JIrbgi9SlpwAqEBvap6uVrLGMGb4nvsYmi3jyJvLm4rFNMe7onL72vSBU+K/WUZULckB9gH1/iEg5oJJCL2+ClaIhzPmkrObLdxGx4mmoaqxZyYq/OZgrY+BGMUpzdp3gEPVlu0JlO6Ngj8OaD+n2B4JZc/vFs0nEC1MGpkR1Ew3IIcYIHTlyuYDMjzN5TJEhBmzTJQY8i6zKMB2uJR0hqwycan9TN9HtWKm8Y1QBcBnQwbRlfRjdbAhwojdggpqM+/S7SvmhpjWTweu1YE9ACDWk7rhoqqqcYbbt0pjw4Z9NXUrvo3GPQX/gp89VJKBk6guSXCVUMepJspawiQLdQ==; 31:CFmiEEeREiiqj3JtMMm9OlvQMtDGRePi1+5LfnhUaLXywzwEBwmVImy/ClmoZOV/7FqJOwSaUc3XpXjyH4qzI+eqWTrezfXbXkdSE+81OKbjNbG+nTubu5O+2saXwJMrFeHpT1/g4fZrhpzs967lNV3fQjyNWyYZ6E0TruXiinR4OcKR/4Z4ZLciysGWXFzoNQBlIF1yg92ku799pq8qkYFsF+e2s172Zx3dz2CFhA4= X-MS-TrafficTypeDiagnostic: CY4PR04MB0665: WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0665; 20:cQFRzkuL7Wc7TFWsF/3RMR4uYncYDuHATJ7SMxKZvBVPr9XztDgpf3z6X0OaqdVqj31qfcxVxdQxPOB8IM7Bh9k5q5q/beTA68lkxCsSoXxfdhjtBLnQGXIc0m/Of63FQTNwPNfDT52LrBM9QHgBTdct1yhLJ1/Lo8rQO1IZiJf+aDRvpDsgs1OVNegfotLoiDGTrkw4vMpG+nBS7I5OnoLQ/MOH0LQezDQDcsq8O2JSq85pleetkoDkl1FrFO1b4Z3B7EUJ2Sw1TCqzrwIg97mG4c2qsGPSprcNnmqd9WTAbKtJ85p7IlbWSZUjmutdRO/VUw4nRlFQW7iMgtPtAKeLjexkvvL3gcb7zksfktMH5q3ysR2/9mndSSMWFQ0G0njGxQJs1xBcVbfDPWGpB3rhYY4jao2sJ1MiM7LsvXUTUqpgNaySpvJkePlskOrjBAOMQ7dNv1AZB55ZUHGIqmln6UndCHoSiezpUmyrpn5f0IKfBnWReLOjWjkhjtZs; 4:bUB8bHIyxra9sHS/caFOb1aichXz+of2x5XGYShWbkeoAoSxFBBm2MEmmu3DvA75fipvqQ+dtOvuPWzI/970+xdKQC2fsve4xxiky6EDjycgEXuLOPtaozxRFLvX6e7dXBgUozbrqPco+jbchtRdGXO8DK7upfNSMhCVRvHDjkDCEOqsNFZF0sVDFpkdwmt2W/0nI0tEj7iszrWu4+R9DjGlvc7gGLbcuP6kLxeOkoUN0TOUuZZ1qJdyHFe0jG2HBi5XeZlBZm2UXbSpquLFd/k9zIw12KXZVNOehXqAj/0= X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Microsoft-Antispam-PRVS: <CY4PR04MB06655A06069D888B531E7CE98C950@CY4PR04MB0665.namprd04.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR04MB0665; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR04MB0665; X-Forefront-PRVS: 04244E0DC5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(189002)(199003)(106356001)(105586002)(47776003)(66066001)(2361001)(53936002)(110136004)(2351001)(42186005)(54356999)(55016002)(72206003)(50986999)(101416001)(86362001)(50466002)(33646002)(23676002)(9686003)(230700001)(3846002)(478600001)(81156014)(68736007)(81166006)(8936002)(8676002)(6116002)(2906002)(4326008)(25786009)(7736002)(305945005)(6916009)(6666003)(5660300001)(189998001)(103116003)(4001350100001)(6506006)(97736004)(83506001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR04MB0665; H:naota.dhcp.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjA0TUIwNjY1OzIzOnZMWUx3MXV0ZEhaNThZSWJJaWpESHg1cWFO?= =?utf-8?B?QkxaSlpxT2t4UklTSkZQaGZuNUcyZktNdDdWaXNYN3FoT2ErUWdyM3Y0V0sx?= =?utf-8?B?VG0zQVI5WTVseTU2K1dvVzl6Y3RFZS9waVRzVjlWU1ZMczU4bTJVZTBxa0dM?= =?utf-8?B?bXh4cnkyUlV3UldiUWs3bU0reHdZTFhkR2pJNmF3bERZRTUveVltejJ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Ak5h+tgubntvE53d6y1CN437yvdLAhR7ZPvjGBM1dvqYu/3HUQ=; 7:R+cOPtr92wZxiXLdwMWl+uTkD65p92A7OiGT14yIvv74Z7zJl2A9dRsxWpf+Lj5DsOiA4uO+rSiJpJHpiIvC35Bk8B1YYMqIiOjq9VhuSRuY3u6RXOiX6qoXglryj8UT2RjL4hDqvnApoeTyur1+CwEVKUfianziPw/IIYI85dQ4QNwODXhjvt0tc/s3vJL/+kYq9ViHjuDBG0g4O1YTvkWlv/d7qHIdvy/dA3TX1jA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0665; 20:W9vje1Z3DJc8u793TvcnIQw47EiLdViOwoC0dhMYWetPUPyRBi4y9xONXFvDrjX/9D7438eq3DhtX72d6ycKfjXO9jSobDH3/uNdgB3Nf+OKFqfi+hL1ShmX2E2SvlgE/7ISgYzb5mjDE0TsPINJcQ8NpKWyXol8VK1Uu26tjAY= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:49:00.7064 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0665 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: <linux-btrfs.vger.kernel.org> X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
On Fri, Sep 08, 2017 at 05:48:55PM +0900, Naohiro Aota wrote: > btrfs_cmp_data_prepare() (almost) always returns 0 i.e. ignoring errors > from gather_extent_pages(). While the pages are freed by > btrfs_cmp_data_free(), cmp->num_pages still has > 0. Then, > btrfs_extent_same() try to access the already freed pages causing faults > (or violates PageLocked assertion). > > This patch just return the error as is so that the caller stop the process. > > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> > Fixes: f441460202cb ("btrfs: fix deadlock with extent-same and readpage") > Cc: <stable@vger.kernel.org> # 4.2 Reviewed-by: David Sterba <dsterba@suse.com> -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index ae8fbf9d3de2..b5971923f15f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3028,7 +3028,7 @@ static int btrfs_cmp_data_prepare(struct inode *src, u64 loff, out: if (ret) btrfs_cmp_data_free(cmp); - return 0; + return ret; } static int btrfs_cmp_data(u64 len, struct cmp_pages *cmp)
btrfs_cmp_data_prepare() (almost) always returns 0 i.e. ignoring errors from gather_extent_pages(). While the pages are freed by btrfs_cmp_data_free(), cmp->num_pages still has > 0. Then, btrfs_extent_same() try to access the already freed pages causing faults (or violates PageLocked assertion). This patch just return the error as is so that the caller stop the process. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Fixes: f441460202cb ("btrfs: fix deadlock with extent-same and readpage") Cc: <stable@vger.kernel.org> # 4.2 --- fs/btrfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html