Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp331838lqb; Thu, 29 Feb 2024 02:11:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqh9mHBhD1bEmT6WUPda1TELHeE1leTrAQ5P+2M6rztcdJBAqdPGXOIRAZQkp1VxcUeQLYdQJF36mCrd9AGGz+UvSgENALOjXIQnUbag== X-Google-Smtp-Source: AGHT+IFrHFHAq1Yk8A95pcxMS81iD5Czf1lWc9PyRcC/KEzPHDwsElgo/ADeG8y3+bJpdZP6RUdu X-Received: by 2002:a0c:f6c8:0:b0:68f:ea00:8a43 with SMTP id d8-20020a0cf6c8000000b0068fea008a43mr1576585qvo.64.1709201499715; Thu, 29 Feb 2024 02:11:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709201499; cv=pass; d=google.com; s=arc-20160816; b=GjNgxSMy5Mk+yPxFoh5Iv3vcp0XGdBYfNpl0jGwVaFi2bpWsdHQXSGJTg/GHujKcf2 gujM54UeWsL/EyW3nZAa2ye5lutcWqVO+CadH6jgU6pN1OYC7nUdTx5aWiNEylnsYce+ +AWa/7KbxBKbzG2iuRWrSwqt9A0nN0S9/MfU0VbX8fycx+kxk11T6gEe1i7jjlFc6n5c /qaNJBfmKLDUDmnilWhUuMa3bDvPjqnjBoJ7pR/8Koe7ydUX1nBbNC6H60dHXNt8Xz/Z IvAHFJReUtHVzwQeSsDrhDeA/9X9qJ+vmEXrTQts4twE8kL2YW0z80XJuXY+b6LYkiHR XyfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qpnCMeSe798693txwKzx+QsgT+NTWESa+LDH2VJuidg=; fh=BhlXLcxBe5IlR9dzNKsz/UIj8nOfKJHFDuQuLp7OkbY=; b=wIa/+N4sXydpNs1DWpFYz4OPkEXjILjqrlvmOs4mycQJxfJWXiRJivfUI61ImxtUhk 3e6Z4hHCp8MNuvLkETIFlVtlYIZ6AVF0ibQp+I5tVloy41GvVl+y54jEDrhZViCwNHco SG72mXlp3lcRn7ZJELgY9rI/a+RlztmQ9AxnEYuDsvg5eeTrAv9KO9gPQfc9KlTzjvE8 slDRrQlJjLT5+9nSk6NB0AudRQlzNSd6vo/E/O871+p44YYdgTIAkoY5xHjWVqnNQ2OO 5kerfaqpdpaQi5nHR8YQ/gEp1Qr/BtJC7iv6rYd9u11CfxKlxDQhH0NPcs03gqbiR7zk RkvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h7dYoOTy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g8-20020a0562140ac800b0068c64a838b8si1019285qvi.417.2024.02.29.02.11.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:11:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h7dYoOTy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 135631C22D34 for ; Thu, 29 Feb 2024 10:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60A4663503; Thu, 29 Feb 2024 10:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h7dYoOTy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8A0A8634FE for ; Thu, 29 Feb 2024 10:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709201401; cv=none; b=M4vZg9drazBq8XmxgVAEYsHNzP8QEZ4AjaVlH5c0tcZUIPVs4YzRuUTtlilfX07b1q4fZZCXyOJdm39NfSSX8FCtDG8dSosUNcFaDyhTpOsJ0yd8m72wdbCnfq6RfekaxuJV4QOry3cu1ZdoG4IHFlJ4KDaCBdUNtjxvHPyYWuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709201401; c=relaxed/simple; bh=NFCnMoMrVuC4cCuJvgRycjqyC2YcWg3DtXlKvOroRlc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Hi3JRTawwtMOqAXyQrNzT9YSgbTQC0mmU7QG50yAXG54PEG8sNW3qkoJbJGwMwYoJKk5EW9pw6T0JRCYCICHgoEVewJJ01vOM2gJ1qTUbwqCWBxOUMrj0fxuV3k+qSd3S1xZm7HCmrLj/oSUFR5TXd93PQw/g+i4xhcMFY21OVg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h7dYoOTy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04CA8C433C7; Thu, 29 Feb 2024 10:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709201401; bh=NFCnMoMrVuC4cCuJvgRycjqyC2YcWg3DtXlKvOroRlc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=h7dYoOTyoUUwJfUYKS8oc/GOmVFCi8gYJOMVwQbnlmCkF71wUj/BjdSpyavLaqZAF /yr1BrQ4NDTDhRqWHMrV6k5OtKvz0ncEGnszdFth4oVSBafR9nc3kcrpvxSfXl6kZz PLjtxRSsf5QuzJ+CKvdXlBvik7E7v2mzKPGPIb3+WDmc4FrFyNH7B51w2e8KmgUUBh DkAUyzz9sQ72N6vTA7Ht5/glAnJlC3jBMWQCQuNEDnniCiBhij7ERX6x/W93UbIyZV dgtYvgHoNTqbhz4MAnlx80D1XtTPFJM4hs+egJ9ueV/Bf3tGygu6NxEzZnemyxjfBZ U8DWDAUF7NBFg== Message-ID: <2b81aa6f-db51-4a7c-97ab-2af2c2fea056@kernel.org> Date: Thu, 29 Feb 2024 18:09:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] f2fs: fix blkofs_end correctly in f2fs_migrate_blocks() Content-Language: en-US To: jaegeuk@kernel.org, Daeho Jeong Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20240226013208.2389246-1-chao@kernel.org> From: Chao Yu In-Reply-To: <20240226013208.2389246-1-chao@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Jaegeuk, Daeho, Any comments on this serials? Thanks, On 2024/2/26 9:32, Chao Yu wrote: > In f2fs_migrate_blocks(), when traversing blocks in last section, > blkofs_end should be (start_blk + blkcnt - 1) % blk_per_sec, fix it. > > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index c21b92f18463..0c728e82d936 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -3841,13 +3841,14 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, > struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > unsigned int blkofs; > unsigned int blk_per_sec = BLKS_PER_SEC(sbi); > + unsigned int end_blk = start_blk + blkcnt - 1; > unsigned int secidx = start_blk / blk_per_sec; > unsigned int end_sec; > int ret = 0; > > if (!blkcnt) > return 0; > - end_sec = secidx + (blkcnt - 1) / blk_per_sec; > + end_sec = end_blk / blk_per_sec; > > f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); > filemap_invalidate_lock(inode->i_mapping); > @@ -3857,7 +3858,7 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, > > for (; secidx <= end_sec; secidx++) { > unsigned int blkofs_end = secidx == end_sec ? > - (blkcnt - 1) % blk_per_sec : blk_per_sec - 1; > + end_blk % blk_per_sec : blk_per_sec - 1; > > f2fs_down_write(&sbi->pin_sem); >