Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6508192rdb; Tue, 2 Jan 2024 04:34:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsM2cNxu6toaWouDjybNv0J/u+Cvyy/Qs9ANbfJRgBTz5speupIg3CCGAcOjhbaEjITGyk X-Received: by 2002:a17:90a:ff84:b0:28c:6463:aa37 with SMTP id hf4-20020a17090aff8400b0028c6463aa37mr14726342pjb.46.1704198849715; Tue, 02 Jan 2024 04:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704198849; cv=none; d=google.com; s=arc-20160816; b=bBFahR1c4QYcc6tFlFQDchBgbTHFRrJqt9D73J1HkpT9GcDqUwcf2WkHlabz0WTAUT Ahdoxj2o4mqq352B6IFlIBqm94td5DSxZsq7gdvPQ815HhfSmP+bv7sU0zlhzDBg/8qN 9uHvLiQlXVbTLqzzC/Qx0Sl33jToOOr1Yq7KF+WjvcDDV7jRL0DKXeehYQ010yJBY//f abKS2kvJG3KFDipE2wj79o+BrBdi1yI/ZOeliQ2pYk4v8q+zcsWmwGs9lyDVwYWaYIQ3 i53lCwYn1l7atePWIQryswxH4OlzfnWK3uyUsaswRRq9xlTWIh1WqM9sChBPCACXNYF9 MMbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=+Mbnn9PH2o5Ok9pyhYLWSDnK9voC8VXPNzWtW0Kk1n8=; fh=G3TYLeMnWlceCSZANxFL0rc/1V8Btv+SGGTzVWLZs4Q=; b=Yt4CeI8Jv69J8jRBrpiKSjvcunSUjEJcxYCQty8TZRVW/UtSVDvpaj0qLoZMIqOCpx Sq4gSc6K4KndxrfhcOU/MPQN7qViF2kBFue1DfLU6kiKtFHlweLZM8+f+7EqiMZV3aJi 27GODNTVXHnf/MBVcHnKF793veiz+VhrrSNhbw2v7K6tH8ePw2UoFT/v+N5QSyimr59C gDkIQRlV5AoB4HPBAUGmnBDqVwfO12/n/jW+S4oUiriwTAk/1HOaUYSLGrg65SWYwbrk wSp2nYCdHb0sf6XAjgPIwEFciYyqFaEyIkRsWznrs0+dKKGJiOH4OZfgtJKMztswwp+I teXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-593-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x5-20020a170902ea8500b001d3ef57d914si20185536plb.95.2024.01.02.04.34.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 04:34:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-593-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-593-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3BD12282B81 for ; Tue, 2 Jan 2024 12:34:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E18A5F510; Tue, 2 Jan 2024 12:34:03 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3D13F4F7 for ; Tue, 2 Jan 2024 12:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4T4C1D1k2QzvTpd; Tue, 2 Jan 2024 20:32:48 +0800 (CST) Received: from kwepemd200008.china.huawei.com (unknown [7.221.188.40]) by mail.maildlp.com (Postfix) with ESMTPS id C3C6E18006E; Tue, 2 Jan 2024 20:33:56 +0800 (CST) Received: from [10.174.177.210] (10.174.177.210) by kwepemd200008.china.huawei.com (7.221.188.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Tue, 2 Jan 2024 20:33:56 +0800 Message-ID: Date: Tue, 2 Jan 2024 20:33:55 +0800 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] ext4: return 0 when ext4_get_group_info failed in __mb_check_buddy To: Kemeng Shi , , , CC: References: <20240102112012.672260-1-yangerkun@huawei.com> <48ec32eb-145d-d6fd-e2d3-bd4a4087627b@huaweicloud.com> From: yangerkun In-Reply-To: <48ec32eb-145d-d6fd-e2d3-bd4a4087627b@huaweicloud.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd200008.china.huawei.com (7.221.188.40) 在 2024/1/2 20:17, Kemeng Shi 写道: > > > on 1/2/2024 7:20 PM, yangerkun wrote: >> The return value for __mb_check_buddy should be a integer. Found this by >> code review. >> > Hi yangerkun, > I think the return value of __mb_check_buddy is actually not used and can > be removed. See [1] for details :). Thanks! Hi Kemeng, Yeah, the return value nowdays help nothing, it's a good choice to remove them all. Thanks. > > [1] https://lore.kernel.org/lkml/20231125161143.3945726-2-shikemeng@huaweicloud.com/ > >> Fixes: 5354b2af3406 ("ext4: allow ext4_get_group_info() to fail") >> Signed-off-by: yangerkun >> --- >> fs/ext4/mballoc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c >> index d72b5e3c92ec..55c70a1b445a 100644 >> --- a/fs/ext4/mballoc.c >> +++ b/fs/ext4/mballoc.c >> @@ -758,7 +758,7 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file, >> >> grp = ext4_get_group_info(sb, e4b->bd_group); >> if (!grp) >> - return NULL; >> + return 0; >> list_for_each(cur, &grp->bb_prealloc_list) { >> ext4_group_t groupnr; >> struct ext4_prealloc_space *pa; >> >