Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4095244pxb; Mon, 30 Aug 2021 18:58:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFkyxAWNZoh20SLTK5kO4gIti+ev0Nx0275BYuFOXeL1THVjDS3GL5lpvR5JkRBw6DrOCZ X-Received: by 2002:a17:906:c085:: with SMTP id f5mr28785689ejz.250.1630375136660; Mon, 30 Aug 2021 18:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630375136; cv=none; d=google.com; s=arc-20160816; b=yCBVg7ggF0EuSEXuGGx2LBCTGTBlYQR88lqAHxkIW7upbCS6QH7ybZz1ULVybJx1bz MHZ6C1GonXLlZWm2fgwXs+QRnAj8NKqDbWHsqPlqJ+rvv3z7kFN4AVphLH1sykknP7i5 m9xkDbQqXHBhPQ5VhQLwy2f/KDlU717gklv5pa4mGgojYjDb3Ql12C/0UvMof5oKvau0 SO+qJwxCGLyE/RPlBG/55aSvOkPu7vTn69qaZooa2YygNdCEF5h5oZmTfQ+f1w5Uw7T/ mBKDxAWNmm+j/uCuPwp/gBZz7Pe/cArToAEKUMtVg6Gf2w2sdMNz0biGxMoJQeK/qNX3 DIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=dZh6bkBKbU2Kvb4d8ci9ZyJ1fdFEZqsKDhqy4LNfiUE=; b=ZmL2dPKjESxmoCMfz1DSl5xeo3fmbj+CeEdFIhCfL2Ilr6lrrt8+l2n9dLXMp+4vBD 6h0qVJsC/gwlwPjPLbIKnN9TxZxksQIpQEmB1jJ7Rni+qv6i0leA7hAmGYzOT6ENFK7r /itMlRDwbaXX7swo+Hz7ylN3nHSqRs6oHmlq7nPGvq/M3iX2AmyNKcnS6zLtd7GJP1zI mEdYlREBW/1APLJsQk4zGiO30PYE067aqEARmspxRJ36qvPyQfyPve0PyGXXB8bfHDJI z31RIp1kb+eAyRu8Vh/9Q+4LWzAhWY2FwzyhFxyOWwySSHW4pMfUmjFVz5d1/Jdd1SpV /iMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XkQ21EPB; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si7582522edu.535.2021.08.30.18.58.33; Mon, 30 Aug 2021 18:58:56 -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=@kernel.org header.s=k20201202 header.b=XkQ21EPB; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239325AbhHaB6B (ORCPT + 99 others); Mon, 30 Aug 2021 21:58:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:44420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239306AbhHaB6B (ORCPT ); Mon, 30 Aug 2021 21:58:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F1CD6101C; Tue, 31 Aug 2021 01:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630375026; bh=F+z5UHuWDdV+ffpMysnS1XGdtsy8b9i8pwL3eUp8Y/Y=; h=Subject:To:References:From:Date:In-Reply-To:From; b=XkQ21EPBzspO8UnY4PdnPN/P5iO5aqRfgY/egkyCMWg2eLOpT1ag6BEIcI2Y6w+0b rt4eWnILpvYj1TOhBiMx0h5wtpRG2sqeCb+AZ57LpfjsHSrCU2QOTAm7+hFtImzycv Nc43yb3AZ3NI/JU8RFe3I3EV1ahBbxPbfbVPRCmWcx0QnMUwLX8RD/PNjN38yvWs7J Ro3qWoob8Q2ge8qVwL7KFc3blISIgwaV13E08VWM8Ysxppr067Vp5xnu3atSPmqnRS bGuhaZZDp0ulipvoM7R9rKH9B5V87mbu5z2BPOn3yrIo8Jk6H2T8k3g93Mu9dGegl8 AfwELM5tUCYWg== Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: deallocate compressed pages when error happens To: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20210831005346.118701-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: Date: Tue, 31 Aug 2021 09:57:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210831005346.118701-1-jaegeuk@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/31 8:53, Jaegeuk Kim wrote: > In f2fs_write_multi_pages(), f2fs_compress_pages() allocates pages for > compression work in cc->cpages[]. Then, f2fs_write_compressed_pages() initiates > bio submission. But, if there's any error before submitting the IOs like early > f2fs_cp_error(), previously it didn't free cpages by f2fs_compress_free_page(). > Let's fix memory leak by putting that just before deallocating cc->cpages. > Fixes: 4c8ff7095bef ("f2fs: support data compression") > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,