Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp324329rwn; Thu, 8 Sep 2022 02:06:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Wes7cGi63YddJ33ZrziDCsET9EgtiGlTnSMPn1FudOEybO0ONGX/EH6HeuKc1ikBtqmJ1 X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr6335990edz.240.1662627988808; Thu, 08 Sep 2022 02:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662627988; cv=none; d=google.com; s=arc-20160816; b=UNHmiH5C6Thyq81arAcmy3WdBgJMlJOdZoYduVUqP7vZNXvLPYCFfr8Jfn8S3VWQkP pQIuq6Kh/IXHswFU6f1/FjMKscCM9qwWSXoO+o1pAUSCehhZGFo9aAPHUOI1HtWye9FS +RkeAMhRgUMmWr/zNCEHvgoqyq9xFK4ZlbhxCWBTl/HfaQATXHk+32dqTZRTzdWpKIEF LN0anAcEAfkGsU/BAySOsQ+dg6xS7ZVafYz42rCIH/E6oq6frWZD6Jej0LC5G4KLgqex y80cvabYpB4D0DRinxBxn0i2iU7c+MbyExbZRbUV1mHMwxq0bTv3rqhJGkveysTqwvNP jG3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U5l4s9dEaUIPCl/QmrOpIinbJY+eoGy9YHOo3H3/ByE=; b=aiORytA4BIah4o+OkGwnW6uc1fLzAe5Gt0b3DRI3L3Mo8Mnj4XjJnSgGE7hFZ/dlEn 7UKPt0MF4g33xDMi8Rmnhu5CzHKD6V8HCR4grsd+cVwEuBk0D/L06VG3cRhAl8fKFPoU 9i7p2X58HF1YHPDvhjZEC+81q1LQe7ZsoyG7Q8F30/Vg3ZKPMNfw9PoC/akjmdPJ1OmC nuPg2zTzWI44jVOfNJW3VOrKLlaIOeIbAwtVjQJNA09d4UHKLQJVf/VfiucQQTHnwett CCtlg9TT1NW55HPZt6pClb0AY7njOETn4EP4TlH4TxjiqBsRqzk5tXoADZVB73MaIIiN l9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KbCD1aQ0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne1-20020a1709077b8100b00773dd25b900si1375231ejc.463.2022.09.08.02.05.58; Thu, 08 Sep 2022 02:06:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KbCD1aQ0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230115AbiIHJD1 (ORCPT + 99 others); Thu, 8 Sep 2022 05:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbiIHJD0 (ORCPT ); Thu, 8 Sep 2022 05:03:26 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D6EF7577 for ; Thu, 8 Sep 2022 02:03:25 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id m3so6512534pjo.1 for ; Thu, 08 Sep 2022 02:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=U5l4s9dEaUIPCl/QmrOpIinbJY+eoGy9YHOo3H3/ByE=; b=KbCD1aQ047YzFbZj5LxtggTZcq1SAkRFUOrucrg3VujMw26vH1bewIiQWVeB5kWTcz DqqgIMAhPgcgh0ltcLgYsT+co/9p7mRjE+NRaii49d4O284fWCjO9jkeIaSBGkvPrOk+ 1qItDCz/37zQb99SN5HcmQ0o/lyGDp09Zgjlrz+k6DhfmeaF7+1Wo9zr4Zv6YVIyi/m1 QOtV02Kq0m0T5jOkJoXnmyIKw/cSUidzqB40ofsMZmQqrb5CYTVyB+UsNW9GPnpnLhKM h7aXUFIAZNF1F6fmJWODDhCdqmGyQ37csbBCrTL++OU3L6z8OkstSh6qdAv6H2DOWSvz wZsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=U5l4s9dEaUIPCl/QmrOpIinbJY+eoGy9YHOo3H3/ByE=; b=rXqBIDoqu3cm7wHGRR1nLgicGKpxjOmk02hwzvseBP+y1gxUr7f/Of5JZdN7nI9flO XmuJHnTZk1cYDINOmQFcQL9i2oHpopPNzOcP2Wvq9u9XolWgU8OhKBNz8hAG3A09AUfu H0EzRwxQCxVq58DQgP0FFVizK//sQCykyHLq0cDSKrP2mrm9XkwtdI/A9jV1J1liyocy f2SZrf2kaWB7F7kUN0VY6lpjbHga+GsrviP75WGjlZJeMaMORDGU1oP2nxfkEn2lBqY/ BMB0GmC6AcOC1foESxjAM4FGCjibv1xGHPoUhwiu5/wOHrgbJ1XdhDN+ZiSPB6akIvVb j6IQ== X-Gm-Message-State: ACgBeo205bBOcaTkOEpjMRI5YHj3SQaYor+8QF53D4U1Ow5o2X1hObWM A3evHpb2/ArVNZsDNUeDN/c= X-Received: by 2002:a17:902:ced2:b0:177:fa1f:4ac4 with SMTP id d18-20020a170902ced200b00177fa1f4ac4mr362135plg.20.1662627805474; Thu, 08 Sep 2022 02:03:25 -0700 (PDT) Received: from localhost ([2406:7400:63:83c4:f166:555c:90a1:a48d]) by smtp.gmail.com with ESMTPSA id f21-20020a623815000000b0053e99f2bf16sm2136000pfa.78.2022.09.08.02.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 02:03:24 -0700 (PDT) Date: Thu, 8 Sep 2022 14:33:20 +0530 From: "Ritesh Harjani (IBM)" To: Jason Yan Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, lczerner@redhat.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH v2 11/13] ext4: factor out ext4_group_desc_init() and ext4_group_desc_free() Message-ID: <20220908090320.tykdh44uhxgimwzf@riteshh-domain> References: <20220903030156.770313-1-yanaijie@huawei.com> <20220903030156.770313-12-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220903030156.770313-12-yanaijie@huawei.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 22/09/03 11:01AM, Jason Yan wrote: > Factor out ext4_group_desc_init() and ext4_group_desc_free(). No > functional change. > > Signed-off-by: Jason Yan > Reviewed-by: Jan Kara > --- > fs/ext4/super.c | 143 ++++++++++++++++++++++++++++-------------------- > 1 file changed, 84 insertions(+), 59 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 69921a850644..468a958cf414 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -4743,9 +4743,89 @@ static int ext4_geometry_check(struct super_block *sb, > return 0; > } > > +static void ext4_group_desc_free(struct ext4_sb_info *sbi) > +{ > + struct buffer_head **group_desc; > + int i; > + > + rcu_read_lock(); > + group_desc = rcu_dereference(sbi->s_group_desc); > + for (i = 0; i < sbi->s_gdb_count; i++) > + brelse(group_desc[i]); > + kvfree(group_desc); > + rcu_read_unlock(); > +} I thought we could use ext4_group_desc_free() in ext4_put_super() too. But I guess in there within the same rcu_read_lock/unlock() we call for kvfree of flex_groups as well. But this change looks good to me. Reviewed-by: Ritesh Harjani (IBM)