Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp601944pxj; Tue, 18 May 2021 10:02:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnbtWr+aFOtF2GXNGyjwbm2AVooDmKXYhg0+iPN1gl4XAh0K6h66cHedfO+XXDB7tXIxQ5 X-Received: by 2002:a17:907:78c5:: with SMTP id kv5mr7096256ejc.146.1621357361834; Tue, 18 May 2021 10:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621357361; cv=none; d=google.com; s=arc-20160816; b=VdhfBibYLmntpa5cfViKga8+KSz7soIlz1+9wGGvX/nfj1Php3Hbw2QSkrvqd2/SOe S7UJXmrtdUIRo8U6VAhuRL8urG64GB82nkYJcHH+6GIDr1eLhE8wTYGi1lRWqE1UZnV9 TS2GMQsgUPe0BkRyJ8bALAErAtOUaSMPV1nwacJmeoxrKO+MdjxvAo6jBMIQQ/kn4iZ/ wKgt8WT3Rewpt/K6mOCKz+MOaT4Eyl7eMot2AgtQy9ktn/JEDDc6C2K16m0kgio4Q4F8 mjSOGqKQCNkdC5NqGCK2C0j68P30AdUuxzH+1W6N0Px88g4RQcGh/tSACQjYYVlCjPuZ oJwg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cFE3GmoyvhUgy2qr+HKNL8V87W2RPcUVlAhd5PWU2DU=; b=nA9YskZZbZOwwsvt8OLZdL1v0eb2zwXV5OpRh0LBtzijjIjHardTiDXY26B6RZgcKL 2claoxa7aEGHrY2///RhueCnen6mrgwoCD4jhnQPn+NlX7GNcsTubguR3rUVxVsPqa2e M5XqqdysX3+hSP+XDjtAhtgNKBXYboRn0vRA/YRxWADoS4GUQuX7BGl1W39p32Uzkdeq hiWoVbBf6Mt1wOoug2qAmnEFHo43pw78Rw7ssDRCABiBecPUTLblX6mcvedikrvEb74+ NBNq3mfo0X3kkR+SQExQ7Xg/7JCrTcRYnJyATSQayxRG0O8IzW0FWO5Y7ORPeH8GD1qe myEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dw+K+riC; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re2si17734025ejb.407.2021.05.18.10.02.15; Tue, 18 May 2021 10:02:41 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=dw+K+riC; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244272AbhEQQHg (ORCPT + 99 others); Mon, 17 May 2021 12:07:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:36360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344688AbhEQPp2 (ORCPT ); Mon, 17 May 2021 11:45:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3E20861D30; Mon, 17 May 2021 14:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262620; bh=nN1uSXNQ8a3lbhzgN5HKgVVjjEN2FZoqB+Fq4mndZOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dw+K+riCHOcjHKkmsLdI8BFV2M7YfcBm43GbU+IlN6cezBfhyw8g0qma13tB7ekHR f8YG1XxFmirdBfa2TtJmU6BUAWGOsGT4V6CjAb3/UZy/R8+lqeP/uQrNavbA9/ggCl endRdGmb7F9sw5UFgVWscqHoDLDrvqbUdSr80Qv8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.10 234/289] f2fs: compress: fix to free compress page correctly Date: Mon, 17 May 2021 16:02:39 +0200 Message-Id: <20210517140313.052870849@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu [ Upstream commit a12cc5b423d4f36dc1a1ea3911e49cf9dff43898 ] In error path of f2fs_write_compressed_pages(), it needs to call f2fs_compress_free_page() to release temporary page. Fixes: 5e6bbde95982 ("f2fs: introduce mempool for {,de}compress intermediate page allocation") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/compress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index d3f407ba64c9..b6b7b1552769 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1321,7 +1321,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, for (i = 0; i < cc->nr_cpages; i++) { if (!cc->cpages[i]) continue; - f2fs_put_page(cc->cpages[i], 1); + f2fs_compress_free_page(cc->cpages[i]); + cc->cpages[i] = NULL; } out_put_cic: kmem_cache_free(cic_entry_slab, cic); -- 2.30.2