Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp93111pxj; Mon, 17 May 2021 21:55:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjHHdmLhk+P20Yg+BjouZTkaoo5mq/SBnEnckBCxgdkMqqXIf4uXBBnGLmXj8iGApSxvsD X-Received: by 2002:a17:907:76fa:: with SMTP id kg26mr4180565ejc.192.1621313747144; Mon, 17 May 2021 21:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621313747; cv=none; d=google.com; s=arc-20160816; b=m72f4Av9kThv4K+pir/LIAb+H60QCu6fK7rg/oJDUU7M/htXLEk9nrVvDHByOGYkyC LO5O8ziNFnlNIwrJuF82HWLNUdC3Ulizes42dtfbdtzaWppsYuEIOyPvFNuW1CYVe49b Gdd1BpIHCiz31H95pld0MQKxzT0XIDtEJk1Nsmhr5GnAX8nbWXljlDnPNzLOFLqosUlx HzoeGwjOCoJ/fwsdesyV7qjV7cl9pOCZCqkCOSNO7vnmNS3rIDK2wBF7BB2Y9FG0GAub yT8NYSmOyt0N2dPd9xH3NEiuVqF1UDwfNgmninbbuG3yJjOdkAtYkwq78TYMtSbkd7xm qH8w== 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=szk9Mamii4sFNOL2P38Gg3a+bAA9aXcBLo2ERL7g/wA=; b=hOlBKG71ZjNuwnDpJeMX9dqjie93pbJZXItE6Ukcy7d+4aCTCWJHsVT76uY7Cc2hV/ XVAT4S2fKhFgUADvgR2QWpeUxDoyyaYwWgKN/NkLIb+jALqPJhYy9DZTzJQ0b6lC9La1 QbF0ZEFzALh/MGPNYGgKWzPjayF7Vg8zRZbA/Oxfv65qklS6M+KotYCm28r8IURSL/8Y C0oB2LtfT5HKfFZPgRPRZjaAnPeS9Q/jp25UbVgO/HQECNR4uZxvWK9GZe1lbgvkrwuz btFL4okJF9RndgWTo5wAIru7O/X3JSDB3xbi64NkhQwnr/8OxChPbEDJN2eOjOvSg41t Q7Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k3kO8X6g; 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 lr3si13808342ejb.151.2021.05.17.21.55.24; Mon, 17 May 2021 21:55:47 -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=k3kO8X6g; 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 S241398AbhEQOo7 (ORCPT + 99 others); Mon, 17 May 2021 10:44:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241008AbhEQOhU (ORCPT ); Mon, 17 May 2021 10:37:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7037E613F7; Mon, 17 May 2021 14:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261062; bh=oDtYYsMwzqTiLIRhGvRZZhL5SsVAlpf8L9z9T+Q0lpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k3kO8X6g+1EtcaV9SRvx1w3WHbH7NhMtGYiAHj3ui5ULIbVHVIkoF5IYUTmfXWpfb 1GOGCE7aIXR763av4LEt4BqqfcvaRQ/flLgEbRHUJIyo1tWAGXWs1wEojyR5Z5AWg5 7zk/WRouS8QkFZcH5bGl9UJ3srucwjjRckesEui4= 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.12 300/363] f2fs: compress: fix to free compress page correctly Date: Mon, 17 May 2021 16:02:46 +0200 Message-Id: <20210517140312.742488519@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 77fa342de38f..146a8eb3891b 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1383,7 +1383,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