Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1778228pxb; Thu, 4 Mar 2021 22:23:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxY/mDkjyOUoYRBiogi0ht2G/6lMJTzCkkwf9aCTmMwfJf9SBLDH9b2FWQQcz5S2yIA4UqF X-Received: by 2002:a92:50c:: with SMTP id q12mr7258966ile.59.1614925423898; Thu, 04 Mar 2021 22:23:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614925423; cv=pass; d=google.com; s=arc-20160816; b=aDLJ4HPor5LDrMwcmYtf8OvOY8EtwjWWLJ+aCd4QYTbkeK1A8rVVisSW36Tv68tNF3 TxU0+jPruxMxUqLh/6oyWDj623HHNnXvqGmmJyPpUsQ20RrjTY31Rg+y1FWD6WNp/7sV J4TP/B4TfWp5TYfmrvAzoxqMq2Avbt1Pocvyq5FE8TV4ihC0TnmzftaxiWd3oHbA1gnE 5fk5tQbw3f/vy4ENm5Wj6Mjw0cW3YWzryH+A6c51UpppkThwImECKuhjPoNh1WI4GxFu Z1MzBxBaLvLec+iTAt7vYWRLTMqR1zpQ6+VUCtXGi1rzflBYmH+2E6LTHnZfT10OB8r+ BQUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=T2GXeD34rY5WDPoWJUbY8rd0SGK0tO+qg0oGbPnlwiE=; b=SOci2CwQ8fvWnbmEXQfaTtUYycjBdZNCjj/MqtfIF6ZIxWTIyosM9fJdLMqvXEetEh +k22qLeo+pAUad5uZuAww2bYGRRoqgu2FQePrgGh8q3BRIIboPOipFkY0dSCxWZ7/WH3 Mdv0rjCQbMUHNDXcRaFOMXzz8bEWtphxgsRq0T7pP7/enryfFWXNKXvISAvAyStfjLoB tcuIi8l3qmcMQHPRkmdFeDyj2pgWJQyI6Gtd5FiLFahiQw1vEauQG33HMGR9g+90hWuQ 1xp8VKFMI8wrSvObQjb9Y6kir2mR+NTCsH21KqWIPlphxn1IK+yS8KSSlvPId8d634Hn j/UA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=uNK37mEC; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r28si1472862jao.125.2021.03.04.22.23.28; Thu, 04 Mar 2021 22:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=uNK37mEC; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbhCEGWi (ORCPT + 99 others); Fri, 5 Mar 2021 01:22:38 -0500 Received: from mail-eopbgr1310079.outbound.protection.outlook.com ([40.107.131.79]:10976 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229457AbhCEGWh (ORCPT ); Fri, 5 Mar 2021 01:22:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hx7WsdlvMtOA/I/lgCAlB+yxFNE7DpJ8yybok6V3pYaOr9v3y7A3zpzHa0l59WA3Ys3A5oY/ZvKpLb1lShAHgstl6yUxWMTlEjTn9/emWIQtt31dQh9Rc2/iAUvetZipBN0hmQDRG3+Lt1F3pJ23gltqbxWMAWGskJDxjvTs0BLabO3Ps8ayiV8kvVeFh3Gpuc+qsJAK1lYwDIDLl2/cns2o8kHVQ+Rwy16P5/o+Eg1oToJORazfkQtX4byE/VEgNq2MPJu38UQ/8Gzer+eq/O59BeHQklwpoDCyCNnv4nxT4vsFnnT4KEvRIiUcaWjlOfDNoNxNVfWLL4JlbbQ1Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T2GXeD34rY5WDPoWJUbY8rd0SGK0tO+qg0oGbPnlwiE=; b=kpmzLZJiRNIsVAVuJvp33bmEftCh0amDtCYB9dhxNkRhqq47btsiY9dh5A42EhzvhyUUT9VgZOHuz5UmUYoC5SZbLZ+fvn3Ujsedwm5/2nlfgCXUiYL6+JockB6fFNrKlrsjw344vfX7KmUe8HfbkfU31JbAIgWiQkSjhWK4/HrsFlP872IjQU0VLH92IiNofqEWx5TVfUMBOH1RtJ7D98bbaRvpkKWt/q/HFMJg5p7gl5SsrnYJnT6dmn02qIDYZ1CCNbLB8VmGAoydiz/ILwSMlV3/xERmj2tRO0j44vVVIpY0Ydw1oWI4Zi0Rq1D7dn/HoJsOfOJ25wVY2HRIqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T2GXeD34rY5WDPoWJUbY8rd0SGK0tO+qg0oGbPnlwiE=; b=uNK37mECXi2zPh4fmfccqbuKmbog3AbsxfU+QnNzWGV/XOtPPVEwkso2EMXKmJiIfTR4IppvkohWgHpHBkV9z3hmyh4yalndsKwqmKJoD6sGDSR/JZsQHvS/lv34sDHM1FYwctDAnUQZ+fXrbUA+EJ4BZBZMbTLUR5DFw5HsQtk= Authentication-Results: lists.ozlabs.org; dkim=none (message not signed) header.d=none;lists.ozlabs.org; dmarc=none action=none header.from=oppo.com; Received: from SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) by SG2PR02MB4021.apcprd02.prod.outlook.com (2603:1096:4:80::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Fri, 5 Mar 2021 06:22:33 +0000 Received: from SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::1143:a7b7:6bd4:83b3]) by SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::1143:a7b7:6bd4:83b3%7]) with mapi id 15.20.3890.032; Fri, 5 Mar 2021 06:22:32 +0000 From: Huang Jianan To: linux-erofs@lists.ozlabs.org Cc: huangjianan@oppo.com, guoweichao@oppo.com, zhangshiming@oppo.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] erofs: avoid memory allocation failure during rolling decompression Date: Fri, 5 Mar 2021 14:22:18 +0800 Message-Id: <20210305062219.557128-1-huangjianan@oppo.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [58.255.79.104] X-ClientProxiedBy: HKAPR04CA0018.apcprd04.prod.outlook.com (2603:1096:203:d0::28) To SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (58.255.79.104) by HKAPR04CA0018.apcprd04.prod.outlook.com (2603:1096:203:d0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Fri, 5 Mar 2021 06:22:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce43fe43-776c-4384-9eee-08d8df9f0f1b X-MS-TrafficTypeDiagnostic: SG2PR02MB4021: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:597; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SqENOXfi9fm6jBxPb8wJ2Rx0T2uliSedf7YubLGUd5ylJdC99nA3YCUcIyzhoiWQVoLZDd08EalMsWfMDWHr0AVrulyhdHYF339OlnER62r4TrvM/lRbdIo/hmCG6QKnwnwllDw8jJ8AHlIVx9qS0Ar6/lD+6JN7lpAu/N5JXNcorLvVLJJYj17aNg9eJgX+iBl6V3wHkbPxaiw9sPzqT+DcEDKDfP0JigSw+fVMhrMjQ0mljcpGuvmMGxdaMwLSU3gvU/ijXuT15XO9Epap+/USkSegDdxtd2m1slx0b1olSO+ygZJC5t9vOCRCFvTc80/dkoC4PIjFU3eyuFrvD1axu8osPHTJW7t2FIMSAXZDEDljYorFlqlpMVr5+uQJ3yuiPElJkHyVUg6+24gMQ+iXabmYWFhIufBW01X5GFNnxoPDCeKHkvQgOUnMOUK2d4cWJH75GnZNofEvDRKQf+9dQUhHsMA4ZiqteSaFQrYGbkeq9Ehzr8PnovDyrvtOFUcRG8cTSgWVrf0ug+LuN91dbx7JLDYmjtmuLXcpHlXX5OuCSfvsC7+EeDWXeZ8oWlUXkMd8mH8SYso6CG2RX/QQ/9PQX41QtmPFOZ594/U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR02MB4108.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(26005)(6512007)(4744005)(2906002)(86362001)(66476007)(1076003)(69590400012)(316002)(8676002)(2616005)(8936002)(6506007)(956004)(5660300002)(6666004)(186003)(16526019)(66946007)(36756003)(478600001)(6916009)(4326008)(6486002)(66556008)(83380400001)(52116002)(11606007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?/6QaFiAd2qPiFKxwQbJ0XieoY910o4vRE3yUhvv1yjevgSoB5NSpmF+ADvfY?= =?us-ascii?Q?SEO2w2wHUI2OoitIc2Sum8ZtIEQJwy+85iS6gMQS4KSSQPMkyqdXaSdesNNU?= =?us-ascii?Q?VDvEDUikgrwdq8prfe5idJtZZ8DlSTSqRNK5CwIPmitTiLvnsgDiMD1O00ws?= =?us-ascii?Q?/cqUWxdjzFiUFW1G4NT1fenW/vvXTUFRUb55NDp1PURaN+Yqlvm4WpI439ng?= =?us-ascii?Q?SAeQpmOMLh7a6EGJ669LztZjPwFg4Tj0AGihJqsjwD9Nwt1cg6bGllSwHFCs?= =?us-ascii?Q?WUN8Hj8cPfWCOQyd78hVoDXMNuSE+4iwrc/uYgOqHtDxah1vAAKI0bHBB1iB?= =?us-ascii?Q?34KNGVxMVFohWKppc9vWB0Kq3q6ZMwNWumTXOCOkGx7f/oicvSHcvueTa3Qp?= =?us-ascii?Q?4i2817aEhe5oTM4BxpVtD7opz/qZVIg2EoYi9i9CQw3INNZxn3qrfUvaR4vy?= =?us-ascii?Q?s/75EvCtgpjealHYIqABoCYNe5FyCXQo7JdlyzWgYbJJRy390iLQFquajnZS?= =?us-ascii?Q?/6+Jnh6433P5W4aY7LZ3G8HK3i6Jl+iauPQoXXg84Xg6stpeMWgI0xOONi+j?= =?us-ascii?Q?SQnjxTDB4dMwiVbOB9f0JY9f+LWNA1OIxg8Ai1NhKbnEGjIMcGbjEokHnCcY?= =?us-ascii?Q?QBuvbFQidvjpfV1eTbZc1ezsOutWT8J7bg+EN+ljT8KXyp91CZmRKHWsXG9p?= =?us-ascii?Q?aVoP6K0uqYKNHx071ndeSNOY3QOWtlHoV9jf5TOPaaZ223/fBdTplhrbsA2W?= =?us-ascii?Q?au5zGIsvs2AlhF0kuxzczpXOUwUoSR3yb/pSYZAxIs2LpM5rnt8DO9Eq8a3v?= =?us-ascii?Q?giIiHvl7N2kW982d0DnpIKax7idLSMeKykDKiWVMdF/s00OVNieHGKMl8Ng0?= =?us-ascii?Q?NjnWfBgiTy/HpJczwoTAwIobS0QDkwsn0oMdq4YUhwjx/sfkpi9k2KwxucnZ?= =?us-ascii?Q?mS35AT3C4biix+r1VR4Noufcm28MSj1CWWBOk7CXqc7kdqbKCVUEZag99wat?= =?us-ascii?Q?hvtoN7ilRIFNeD4IsAg0GBquukI8AyPm1sWmR3HWymnn6jni6sJXTDJbDo2u?= =?us-ascii?Q?IjgOSpK3/GClCy49/xX+MHYwSHNrk3BClBnW2vcLm0gZSsuQC8x0KTa+NaEJ?= =?us-ascii?Q?FzHYGLPPvCk5hc321F4YcLV3lHSkLJ3c1lRJ5sY8Ic3ynN3UYMFaAr07mVRP?= =?us-ascii?Q?8uHmlTlwMTRcjmJk42AgjXmCi6d9nG5m4ysongwdrqNcdjRa2vppZj2NRsSt?= =?us-ascii?Q?DxsvrOY2LSCZMPFWEsYeM429CJvPR3DPZn8hMaZBza0fNEUbncINsRTGJsTX?= =?us-ascii?Q?o1v223VvmTU7UCaJTjMfwFfU?= X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce43fe43-776c-4384-9eee-08d8df9f0f1b X-MS-Exchange-CrossTenant-AuthSource: SG2PR02MB4108.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 06:22:32.4384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: megKlWD5KlpkRQYimAurhCH/Pg1cPehBDdJDURyQrJlQ+Ea0HTsUz2X3x/mT3o6C4zGBALoGn13yDc9PtdsyLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR02MB4021 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It should be better to ensure memory allocation during rolling decompression to avoid io error. Signed-off-by: Huang Jianan Signed-off-by: Guo Weichao --- fs/erofs/decompressor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index 49347e681a53..fb0fa4e5b9ea 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c @@ -86,7 +86,7 @@ static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq, victim = availables[--top]; get_page(victim); } else { - victim = erofs_allocpage(pagepool, GFP_KERNEL); + victim = erofs_allocpage(pagepool, GFP_KERNEL | __GFP_NOFAIL); if (!victim) return -ENOMEM; set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE); -- 2.25.1