From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6BC6C433E0 for ; Thu, 18 Jun 2020 03:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7B9421D82 for ; Thu, 18 Jun 2020 03:28:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbgFRD2g (ORCPT ); Wed, 17 Jun 2020 23:28:36 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:54342 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726893AbgFRD2f (ORCPT ); Wed, 17 Jun 2020 23:28:35 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 519763C700A116FC05BF; Thu, 18 Jun 2020 11:28:32 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.208) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 18 Jun 2020 11:28:22 +0800 Subject: Re: [PATCH v3] f2fs: use kfree() instead of kvfree() to free superblock data To: Jaegeuk Kim , Eric Biggers CC: Denis Efremov , , References: <20200605181533.73113-1-efremov@linux.com> <20200609221446.24537-1-efremov@linux.com> <20200609222546.GA24766@sol.localdomain> <20200615175800.GA117170@google.com> From: Chao Yu Message-ID: <033a4854-5ebd-4db4-c60f-f0f6826d70ea@huawei.com> Date: Thu, 18 Jun 2020 11:28:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200615175800.GA117170@google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/6/16 1:58, Jaegeuk Kim wrote: > On 06/09, Eric Biggers wrote: >> On Wed, Jun 10, 2020 at 01:14:46AM +0300, Denis Efremov wrote: >>> Use kfree() instead of kvfree() to free super in read_raw_super_block() >>> because the memory is allocated with kzalloc() in the function. >>> Use kfree() instead of kvfree() to free sbi, raw_super in >>> f2fs_fill_super() and f2fs_put_super() because the memory is allocated >>> with kzalloc(). >>> >>> Fixes: 5222595d093e ("f2fs: use kvmalloc, if kmalloc is failed") >>> Signed-off-by: Denis Efremov Reviewed-by: Chao Yu Thanks, >> >> I don't think "Fixes" is appropriate here. > > Agreed. I queued this Cl without it. :) > Thanks, > >> >> kvfree() still works on kmalloc'ed memory; it's just not preferred. >> >> So this is more a cleanup than a fix. >> >> - Eric > . >