Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp211471rwi; Wed, 26 Oct 2022 23:31:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ORdK5NA++UKy3KOmB/jBvsUZBgCvGKD8/CekO6aSp6h/40dx+GFcYKq/brOFtLRP43MUk X-Received: by 2002:a05:6a00:98d:b0:56c:7c5c:da30 with SMTP id u13-20020a056a00098d00b0056c7c5cda30mr4550309pfg.22.1666852315851; Wed, 26 Oct 2022 23:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666852315; cv=none; d=google.com; s=arc-20160816; b=OkYvsVhNg3pQwwA0CWzyFok0mHibdHmxmlO36hgiPeZhLRgg1qfpQBksQ5negCu7+V syFqopiOKGhYBpjwuM5QYoydHK5W8PplUxvjM3/v7kOY/3mkWZS/q/I3R7BWku1M1Cwj 09VUcvnoxRR9v/kjrDOm9VUg3S6HcL/sAzxgB6iNBlAF0sahMpsTTZsGRspMxxANy3XW 9hCFj8ZA/L5vnGeCp16CsZsQJpSz7oFfzJA5CmzD+UNe1BpDjw7XjCjQNIZeBZGxBSA8 xz2hH6N+ls/FcHjWe93DOKv6WSiXs1uqmZz7+G62J8+yl0iHuUQEC2/7BlduqOSuWzFV WYrQ== 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 :cc:to:subject; bh=C08y7cuXpXhKA+J7xV7ilYNWnFdADAXfHx25lOTamu0=; b=Vp0BtPh6PZxHFiS+2lly36ZC6uEsr+wfNtom0Ly0/kqrm0Bd3C9nl/Fw4umKXZdmgl jM5li3CwdmujM530b6cCcMJBhg32ArGsdpuo/nDwO8NyOtpzJNBYZaJWaiAgI7SadpmX GpV9hGgVkKA10JLjSfg4Hod1/mb0DALAVuGHR3KgoJLCjjmd82fl2T/2eJWSXCwGbkbc THIogO5oTxa9IB3h/65suCDlWRffxI82ObXwOm9CoAwJ/wPwqOeSfjv71PLjY/F07SJp kOagt55tO4hvYol0TqatPYuHeDIPuHdZZAGTQDMUJXnjUyg1U2VBQvg+kDJVp947hDvJ RzIQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o8-20020a170902778800b0018659ff71d2si625167pll.62.2022.10.26.23.31.36; Wed, 26 Oct 2022 23:31:55 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbiJ0G3l (ORCPT + 99 others); Thu, 27 Oct 2022 02:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbiJ0G3k (ORCPT ); Thu, 27 Oct 2022 02:29:40 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE90186E7 for ; Wed, 26 Oct 2022 23:29:38 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MybHs4J0wz15MBn; Thu, 27 Oct 2022 14:24:41 +0800 (CST) Received: from [10.174.179.14] (10.174.179.14) by canpemm500004.china.huawei.com (7.192.104.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 27 Oct 2022 14:29:35 +0800 Subject: Re: [PATCH] ext4: make ext4_mb_initialize_context return void To: Guoqing Jiang , , CC: References: <20221027032435.27374-1-guoqing.jiang@linux.dev> From: Jason Yan Message-ID: Date: Thu, 27 Oct 2022 14:29:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20221027032435.27374-1-guoqing.jiang@linux.dev> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.14] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 2022/10/27 11:24, Guoqing Jiang wrote: > Change the return type to void since it always return 0, and no need > to do the checking in ext4_mb_new_blocks. > > Signed-off-by: Guoqing Jiang > --- > fs/ext4/mballoc.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 9dad93059945..5b2ae37a8b80 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -5204,7 +5204,7 @@ static void ext4_mb_group_or_file(struct ext4_allocation_context *ac) > mutex_lock(&ac->ac_lg->lg_mutex); > } > > -static noinline_for_stack int > +static noinline_for_stack void > ext4_mb_initialize_context(struct ext4_allocation_context *ac, > struct ext4_allocation_request *ar) > { > @@ -5253,8 +5253,6 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac, > (unsigned) ar->lleft, (unsigned) ar->pleft, > (unsigned) ar->lright, (unsigned) ar->pright, > inode_is_open_for_write(ar->inode) ? "" : "non-"); > - return 0; > - > } > > static noinline_for_stack void > @@ -5591,11 +5589,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, > goto out; > } > > - *errp = ext4_mb_initialize_context(ac, ar); > - if (*errp) { > - ar->len = 0; > - goto out; > - } > + ext4_mb_initialize_context(ac, ar); This changed the logic here slightly. *errp will not be intialized with zero after this change. So we need to carefully check whether this will cause any issues. Thanks, Jason > > ac->ac_op = EXT4_MB_HISTORY_PREALLOC; > seq = this_cpu_read(discard_pa_seq); >