From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: [PATCH] mkfs.f2fs: fix wrong curseg check Date: Fri, 25 Aug 2017 17:10:55 -0700 Message-ID: <20170826001055.4478-1-jaegeuk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1dlOgp-0002u1-TZ for linux-f2fs-devel@lists.sourceforge.net; Sat, 26 Aug 2017 00:11:03 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1dlOgp-0002tY-7n for linux-f2fs-devel@lists.sourceforge.net; Sat, 26 Aug 2017 00:11:03 +0000 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim We should avoid i==j, otherwise we always assign 0~5 segments. Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index b379e80..219c2a7 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -123,7 +123,7 @@ static void verify_cur_segs(void) for (i = 0; i < NR_CURSEG_TYPE; i++) { for (j = 0; j < NR_CURSEG_TYPE; j++) - if (c.cur_seg[i] == c.cur_seg[j]) + if (i != j && c.cur_seg[i] == c.cur_seg[j]) break; } -- 2.14.0.rc1.383.gd1ce394fe2-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot