Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp377526ybx; Wed, 6 Nov 2019 18:55:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzLMIbl3Q0V2SRziTNoMu1vTgxbyZV9GpnvJP/y4BlxpDsiXsZOz44R7dqHIOYKz6bathc9 X-Received: by 2002:a50:eacc:: with SMTP id u12mr1141937edp.290.1573095320102; Wed, 06 Nov 2019 18:55:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1573095320; cv=pass; d=google.com; s=arc-20160816; b=EsqnLr6+jRqwdCDVhaHJlpcvvmYWrPg5yRNpnFmcnVPh+PPhIJYKsNduWW3EmdKT0M +nnDnw6aAslCxctdRav2zStqzF3qlGxc1/T6b9LaxpAeShxc4611BzovY92zWlDIn+Tq fnHrJsmQkTjM4FvmgwIwEYeNIv4pU6QXzQYX7MboFS4pG2s1eEOGGX33RZzIkeL7k2HO tpXWyMFh8VGf5oBLrlaO8oe61g+bl26fZ46dML0FKX6lKRuCUD5hT1Zu+qLuw9iOgTKc NRbovTO/ZOcuYf9RUcELVHH6EXhfuJazjkidf6DxEriRFcMdnWCLVfUvyw87DRRXosb9 5/Rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to :reply-to:from:date:dkim-signature; bh=kOfMmBVsaB0uG9/GOqond2RwARJXXM3djFxFU6ABHEE=; b=FM0Gkrz+ywCtJfri49DhCLunuRqHhosxY2Z1Si1OJZ9EYiBHkHeF8d9sjnoB2CO0D4 wqxJO2qLgQ1NDmUsvGdDr9ZkXFcaapYalPMTm6CL2DgEJl8wkig29nn1X5QkHw/s8NE0 1HzuUnbbwcUsHxB4pge30MrP1vOwB3D4Dvu4reY3sE84LpI+R10OKHJFBuRCJz4kZ52z Vxh2DofwYQuiDv5RFas7MShuqEgmrOkRrTktOaXSQWeNoDUr5qKGtwtM3COXcAmQ9Hiq qbsU/cak6HkGWX7P1eUu+iji3CuS6uLHHGCv77ygCsYuW8SKc1Ev/4w9EIsgKv55PTCI wDtQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=LQqXRtW3; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si579633ejc.148.2019.11.06.18.54.55; Wed, 06 Nov 2019 18:55:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=LQqXRtW3; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbfKGCyw (ORCPT + 99 others); Wed, 6 Nov 2019 21:54:52 -0500 Received: from sender2-pp-o92.zoho.com.cn ([163.53.93.251]:25387 "EHLO sender3-pp-o92.zoho.com.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727665AbfKGCyw (ORCPT ); Wed, 6 Nov 2019 21:54:52 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1573095284; cv=none; d=zoho.com.cn; s=zohoarc; b=Sp4LJjwZjmKp/YDrJuCR5/O0ofa+4d1J8y/aWeqZOmv4fXA+P0opWZKGYYqrd6++epAMRzR2bf4RdXOv+6nj38ncqHCMaX14WyJtaRRZxkcGyP0ab8QY+3UVkd5xY0GJP7xBm7GS7mK+ca2Kct54ZZmnRR3hJ7M9auCxT7qb4Ug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1573095284; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:Reply-To:References:Subject:To; bh=kOfMmBVsaB0uG9/GOqond2RwARJXXM3djFxFU6ABHEE=; b=OhI96ZCefD2WzKQds7MH1EF0YxyK1uCveTXtyCJUDm69X6193FRXY7OGAXlL7iT73b9WIg10evWWSt9df2vC6kcvSuQr7NF6rjQhG4jdKYTSutqnbJ3oI2H89zCYi90Fg7nEtEiu3MyFe2UoHSzxz1XSs2NsnrC3NgKVAX/9Nf4= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1573095284; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Date:From:Reply-To:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; l=755; bh=kOfMmBVsaB0uG9/GOqond2RwARJXXM3djFxFU6ABHEE=; b=LQqXRtW3CdbamwPJO3EsDBcu8BsNvPo6Dajt4GNt71WL9rh1Oj9g9JmkM/cT+RoI Gz51gfm1gnHcK78ymhGFBHvruUQpHER9iPecLLiYNHfwXlbIcRyLdDRNBGGReQ0BI2i I1q4t4tP6ucMrOROmymoRlsbqwntxLPQZYz8V3lM= Received: from mail.baihui.com by mx.zoho.com.cn with SMTP id 1573095283537794.0021523349895; Thu, 7 Nov 2019 10:54:43 +0800 (CST) Date: Thu, 07 Nov 2019 10:54:43 +0800 From: Chengguang Xu Reply-To: cgxu519@mykernel.net To: "Jan Kara" Cc: "jack" , "linux-ext4" Message-ID: <16e43c91b4e.12c0f5d17918.413402503051848643@mykernel.net> In-Reply-To: <20191106154236.GB12685@quack2.suse.cz> References: <20191104114036.9893-1-cgxu519@mykernel.net> <20191104114036.9893-2-cgxu519@mykernel.net> <20191106154236.GB12685@quack2.suse.cz> Subject: Re: [PATCH 2/5] ext2: code cleanup by calling ext2_group_last_block_no() MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: Medium User-Agent: ZohoCN Mail X-Mailer: ZohoCN Mail Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E4=B8=89, 2019-11-06 23:42:36 Jan Kara <= jack@suse.cz> =E6=92=B0=E5=86=99 ---- > On Mon 04-11-19 19:40:33, Chengguang Xu wrote: > > Call common helper ext2_group_last_block_no() to > > calculate group last block number. > >=20 > > Signed-off-by: Chengguang Xu >=20 > Thanks for the patch! I've applied it (as well as 1/5) and added attache= d > simplification on top. >=20 In ext2_try_to_allocate() +=09=09if (my_rsv->_rsv_end < group_last_block) +=09=09=09end =3D my_rsv->_rsv_end - group_first_block + 1; +=09=09if (grp_goal < start || grp_goal > end) Based on original code, shouldn't it be if (grp_goal < start || grp_goal >= =3Dend) ? Thanks, Chengguang