[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACOAw_yn4m+nEGMEX8RL1xFEaZpzXvjUhUdSoo9d2EeGfzPrAA@mail.gmail.com>
Date: Thu, 29 Feb 2024 09:41:33 -0800
From: Daeho Jeong <daeho43@...il.com>
To: Chao Yu <chao@...nel.org>
Cc: jaegeuk@...nel.org, Daeho Jeong <daehojeong@...gle.com>, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/4] f2fs: fix blkofs_end correctly in f2fs_migrate_blocks()
On Thu, Feb 29, 2024 at 2:11 AM Chao Yu <chao@...nel.org> wrote:
>
> Jaegeuk, Daeho,
>
> Any comments on this serials?
>
> Thanks,
No functional difference here, since start_blk is always aligned with
the section address.
However, this is more clear in itself.
Reviewed-by: Daeho Jeong <daehojeong@...gle.com>
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 <chao@...nel.org>
> > ---
> > 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);
> >
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@...ts.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Powered by blists - more mailing lists