Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2940664pxb; Sun, 28 Feb 2021 19:19:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHVTqMu+KCBoZ1kANyGME6YV3tP8m/asLhD1ZnN/S7i1VP/fkl34F1HbVjlwgQ0girehLo X-Received: by 2002:a17:906:2bd6:: with SMTP id n22mr13851148ejg.91.1614568778108; Sun, 28 Feb 2021 19:19:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614568778; cv=none; d=google.com; s=arc-20160816; b=zq6+mdG38HjIAKpd9FsBm/H1GSRjLhmitaR4pydVnp8Z0baxNeHDISiM8JthZPxU1l CnGJXMdlfyYqJHqPNyLXYXxjWGGndPuYJveV+/T3M1V8rVL0HI2d5mA9yAi908LjwRqt AFi4IIdxaQApyFwycABYlJO4nzUTKylTUJ186ggRaJIcvZL+tQBk15ScEjOnFdJvL1HM LT58lGi4Ft4ko7t4Qe/AizGPlp7R0k9zNL8zlkcdcb+Ag1jeNZ4It24e23kICMHDkN/a xNqoZpvx7AMe9CRm6vfapRWU2SKCQ0tPbzZ0lMDQUgRB9g6+LBMxZX6GK+8zLvIxzn/6 yStg== 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=lwkRF6LjufLDtInGagjRztGTIyEyT/j/RurydVEpo88=; b=su9LJ2qn1xXUExlFFqKtzXGeKFR3mzEXO9CNts4tJdYRvlq9yzWqqHH/U2YuK820sv Oi0ILkoaC57tCia2NdjsUj+es/5zKVsLeGkmP6dogjYF9C7c9dwU/+Najr3mQt/xlH3N 2YXQOWWAGBz0NmvqRh97vpTR8s0U6jLl3/PxXK7bLwn+2pw+ryPvQh1ht9GH5RAI7L5x x5t0c5UvpW5SRV/YkzugD2UMSzhopcnRVVZLLa2QXOWW/Y2IaBnlMdJoyg4Xx2E36Mtd /Hau7NewHnxxjY/dpENQs8Ugv/+U3AXHNWSZvhEiwInhiPZ+/8rvIG8hvkMrlIklXjKM QIXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si10011604ejf.627.2021.02.28.19.19.15; Sun, 28 Feb 2021 19:19:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbhCACB6 (ORCPT + 99 others); Sun, 28 Feb 2021 21:01:58 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13098 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbhCACB5 (ORCPT ); Sun, 28 Feb 2021 21:01:57 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dpk3C65zWz16Dpp; Mon, 1 Mar 2021 09:59:35 +0800 (CST) Received: from [10.136.110.154] (10.136.110.154) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.498.0; Mon, 1 Mar 2021 10:01:13 +0800 Subject: Re: [f2fs-dev] [PATCH 2/3] f2fs: fix last_lblock check in check_swap_activate_fast To: Huang Jianan , CC: , References: <20210227120231.136559-1-huangjianan@oppo.com> <20210227120231.136559-2-huangjianan@oppo.com> From: Chao Yu Message-ID: Date: Mon, 1 Mar 2021 10:01:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20210227120231.136559-2-huangjianan@oppo.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.110.154] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/27 20:02, Huang Jianan via Linux-f2fs-devel wrote: > Because page_no < sis->max guarantees that the while loop break out > normally, the wrong check contidion here doesn't cause a problem. > > Signed-off-by: Huang Jianan > Signed-off-by: Guo Weichao > --- > fs/f2fs/data.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index a1498a1a345c..4dbc1cafc55d 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -3804,7 +3804,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis, > last_lblock = bytes_to_blks(inode, i_size_read(inode)); > len = i_size_read(inode); > > - while (cur_lblock <= last_lblock && cur_lblock < sis->max) { > + while (cur_lblock + 1 <= last_lblock && cur_lblock < sis->max) { while (cur_lblock < last_lblock && cur_lblock < sis->max) { It's nitpick, if necessary, I guess Jaegeuk could help to change this while merging. Reviewed-by: Chao Yu Thanks, > struct f2fs_map_blocks map; > pgoff_t next_pgofs; > >